Forum Discussion
HTTP/HTTPS discrepancy for HTTP::respond iRule
Here's the relevant chunk of my iRule code:
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:
[aaron@home ~]$ curl -k http://host.example.test/anything
Services are currently down for maintenance.HTTPS, however, throws this error:
[aaron@home ~]$ curl -k https://host.example.test/anything
curl: (56) SSL read: errno -5961Any idea what I'm doing wrong?
3 Replies
- Brad_Parker
Cirrus
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.
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.
- sfuerst_116779Historic F5 Account
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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com