Forum Discussion
Dayton_Gray_103
Nimbostratus
Jun 07, 2007SSL unencrypt/reencrypt after looking at header
Here is my situation.
We are looking to send SSL (port 443) traffic to different pools based upon host header. and either un-encrypt or re-encrypt based upon pool used. I have not found any solution after digging through the forums.
Basically we are looking to send 443 traffic to a pool pointing to a different data center (re-encrypted via SSLServer profile) if it does not match a certain host header. If the host header is matched, it needs to send it unencrypted to a local pool (local web servers).
Is there anyway to do this via iRule? From what I've read I'm not sure that it is possible so we came up with another hair-brained scheme to have 3 virtual servers. The first will un-encrypt (client SSL) and the pool would point to the second Virtual server. The second virtual server would re-encrypt (server SSL) and have an iRule which would look at the host header. If the host header did not match it would send the traffic to the other datacenter and if it did match send to the third Virtual server. The third virtual server would simply un-encrypt (client SSL) and send to the internal web servers.
Does this sound feasible? I have tested and the BigIP seems to have a problem connecting back to itself (pool pointing to another Virtual Server). I have tried this doing just port 80 traffic and it doesn't seem to work. My guess is that it is having a problem with NAT/SNAT tables. Any suggestions?
- Deb_Allen_18Historic F5 AccountYou can certainly inspect the host header and act on the value once you've decrypted the request.
HTHwhen HTTP_REQUEST { set reencrypt 0 if { [HTTP::header Host] == "host1.domain.com" }{ pool LocalPool } else { set reencrypt 1 pool RemotePool } } when SERVER_CONNECTED { if { $reencrypt == 0 }{ SSL::disable } }
- Dayton_Gray_103
Nimbostratus
I get this error with this iRule (BigIP LTM 9.4): - Dayton_Gray_103
Nimbostratus
Disregard... it's just a missing { - Dayton_Gray_103
Nimbostratus
I seem to bet getting an error in the webserver when a server SSL profile is in place. If I remove the server SSL profile it works properly. Any idea why I might be seeing this error? It looks like it still may be encrypted. - Dayton_Gray_103
Nimbostratus
Bump. Anyone know why this still looks encrypted on the web server when the host header matches? - Dayton_Gray_103
Nimbostratus
I added some logging into the iRule. According to the logs it looks like it is getting redirected to the proper pool and that the SSL::Disable is triggering: - Dayton_Gray_103
Nimbostratus
It looks as if I have run into a bug with the 9.4 Hotfix 4 release. I have tried the above code on a 9.2 BigIP and it is working without issue. I am communicating with F5 now to determine what the problem is. - Ian_Amos_37833
Nimbostratus
Posted By Byzandula on 06/07/2007 8:36 PM
- hoolio
Cirrostratus
The missing { should be at the end of the line of the first 'if':when HTTP_REQUEST { set reencrypt 0 if { [HTTP::header Host] == "host1.domain.com" }{ pool LocalPool } else { set reencrypt 1 pool RemotePool } } when SERVER_CONNECTED { if { $reencrypt == 0 }{ SSL::disable } }
- Ian_Amos_37833
Nimbostratus
Excellent, thank you.TCL error: Rule Test-4 HTTP_REQUEST - cant use non-numeric string as operand of ! while executing if { not [HTTP::uri] starts_with /exchange/ || [HTTP::uri] starts_with /exchweb/ } { pool content log local0.test4-1 } else { set disable 0...
when HTTP_REQUEST { set disable 1 if { not [HTTP::uri] starts_with "/exchange/" || [HTTP::uri] starts_with "/exchweb/" } { pool UAT-content log local0."test4-1" } else { set disable 0 pool OWA-Pool log local0."test4-2" } } when SERVER_CONNECTED { if { $disable == 1 }{ SSL::disable log local0."nossl" } }
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