# HTTP/HTTPS discrepancy for HTTP::respond iRule

**URL:** <https://community.f5.com/t/http-https-discrepancy-for-http-respond-irule/550>\
**Category:** Technical Forums\
**Tags:** management, irules, devops, ltm, application-delivery\
**Created:** [November 5, 2015, 8:16pm UTC](https://community.f5.com/t/http-https-discrepancy-for-http-respond-irule/550 "2015-11-05T20:16:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AaronMLong\_1021](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@AaronMLong\_1021](https://community.f5.com/u/AaronMLong_1021)\
**Post date:** [November 5, 2015, 8:16pm UTC](https://community.f5.com/t/http-https-discrepancy-for-http-respond-irule/550/1 "2015-11-05T20:16:19Z")

</div>

Here’s the relevant chunk of my iRule code:

```tcl
when HTTP_REQUEST {
        switch -glob [HTTP::host] {
                "host.example.test" { HTTP::respond 503 content "Services are offline for maintenance.\n" }
        }
}

```

However, I see different behaviour depending on whether I apply the iRule to HTTP or HTTPS VIP. HTTP seems to work:

```tcl
[aaron@home ~]$ curl -k http://host.example.test/anything
Services are currently down for maintenance.

```

HTTPS, however, throws this error:

```tcl
[aaron@home ~]$ curl -k https://host.example.test/anything
curl: (56) SSL read: errno -5961

```

Any idea what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![Brad\_Parker](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Brad\_Parker](https://community.f5.com/u/Brad_Parker)\
**Post date:** [November 5, 2015, 8:20pm UTC](https://community.f5.com/t/http-https-discrepancy-for-http-respond-irule/550/2 "2015-11-05T20:20:58Z")

</div>

Do you have a client SSL profile on the virtual server that you have the iRule attached to? If not you will get RSTs trying to do any HTTP profiles.

---

<div class="post-metadata">

**Author:** ![AaronMLong\_1021](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@AaronMLong\_1021](https://community.f5.com/u/AaronMLong_1021)\
**Post date:** [November 5, 2015, 8:45pm UTC](https://community.f5.com/t/http-https-discrepancy-for-http-respond-irule/550/3 "2015-11-05T20:45:02Z")

</div>

Yes, there is nothing awry with the VIP, it works perfectly normally when called under normal operations. It’s this iRule that I’m trying to apply to block traffic for maintenance which is causing problems.

---

<div class="post-metadata">

**Author:** ![sfuerst\_116779](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sfuerst\_116779](https://community.f5.com/u/sfuerst_116779)\
**Post date:** [November 5, 2015, 9:10pm UTC](https://community.f5.com/t/http-https-discrepancy-for-http-respond-irule/550/4 "2015-11-05T21:10:19Z")

</div>

Are you doing anything else afterwards in that iRule (or another triggered by the same event) that uses HTTP iRule commands? If so, those operations will fail, and cause the connection to be dropped. (After calling HTTP::respond, the HTTP context is gone.)

You may want to look in /var/log/ltm for error messages.
