Forum Discussion
Nathan_McKay_67
Nimbostratus
Jan 03, 2007Possible to selectively enable/disable SSL and HTTP profiles?
Hi,
I am attempting to selectively enable client-side SSL processing based on a condition - pool member availability in this case.
Normally the virtual server in question will perform no SSL processing, so no client-SSL profile is assigned by default (nor is an HTTP profile obviously). However, in the event that there are no pool members available, I need the VS to apply a client-SSL profile, complete an SSL handshake with the client, and return an HTTP redirect.
The problem is, that the LTM will not let me assign an iRule that employs the SSL::profile command unless an exising SSL profile is applied to the virtual server (same goes for HTTP:: commands). The error message is as follows:
BIGpipe: rule modification error:
01070394:3: SSL::profile in rule (pool_unavail_redirect_ssl) requires an associated SERVERSSL or CLIENTSSL profile on the virtual server (vs-test).
My iRule is as follows:
when CLIENT_ACCEPTED {
set mypool "some_pool"
set myredir "http://example.com/error.html"
if { [ active_members $mypool ] < 1 } {
SSL::profile clientssl
SSL::enable
HTTP::enable
}
}
when HTTP_REQUEST {
HTTP::redirect $myredir
}
Note that I have also tried assigning both a client-ssl profile and http profile, and then using an else statement in which I run SSL::disable and HTTP::disable. While I can successfully load this configuration, I cannot seem to get it to work.
Is this even possible, and if so, what am I missing? Is there a better way to do this?
Thanks in advance,
Nathan
- Nathan_McKay_67
Nimbostratus
PS - I am running LTM version 9.1.2. - hoolio
Cirrostratus
I don't believe you can dynamically add a profile to a virtual server. You can only disable/enable a profile that is already associated. I don't think there are any plans of changing this.when RULE_INIT { set mypool "some_pool" set myredir "http://example.com/error.html" } when CLIENT_ACCEPTED { if { [active_members $mypool] > 1 } { SSL::disable HTTP::disable pool $mypool } } when HTTP_REQUEST { HTTP::redirect $myredir }
- Nathan_McKay_67
Nimbostratus
Thanks for the reply. Yes I am trying to decrypt the HTTPS traffic and send a redirect if the pool is down but otherwise leave it alone and LB the connection as is. I was able to get your suggested rule to work with a little tweaking:when RULE_INIT { set mypool "some_pool" set myredir "http://example.com/error.html" } when CLIENT_ACCEPTED { global mypool if { [active_members $mypool] > 0 } { SSL::disable HTTP::disable pool $mypool } } when HTTP_REQUEST { global myredir HTTP::redirect $myredir }
- Nathan_McKay_67
Nimbostratus
Hi again.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects