Forum Discussion
Stephan_Manthey
Nov 14, 2004Historic F5 Account
irule to insert a client-cert into a proxy-request
we want to use the big-ip to act as a
https-proxy that inserts a client-cert
to request a server via another proxy.
can this be solved by in irule?
the issue here from my perspective is
the initial session setup between the
client and a proxy if using https. by
"connect" (in clear text) the client
tells where it wants to be connected
to.
its different from the usual procedure
in a direct communication between a
client and a server. there the rsa-
handshake happens first. from that
point everything is encrypted.
thanks in advance.
stephan
- gomes_127447Historic F5 AccountWhy not use a serverssl profile to handle the encrypted connection between the BIG-IP and the Proxy server?
- Stephan_MantheyHistoric F5 Accounttried that. but the session setup doesnt work.
- gomes_127447Historic F5 Accountdoes it fail on the SSL level? If so you need a valid signed certificate on the BIG-IP.
- Stephan_MantheyHistoric F5 Accountfor auth on the destination-proxy a valid
- unRuleY_95363Historic F5 AccountWe have had a hard time figuring out exactly what you are trying to solve. So, I suggest we try to break apart the problem into some smaller pieces.
rule proxy-connect { when CLIENT_ACCEPTED { set proxied 0 TCP::collect } when CLIENT_DATA { binary scan [TCP::payload] a* request set req_len [string first "\r\n\r\n" $request] if { $req_len == -1 } { Couldn't find the complete request, must not have it all yet TCP::collect return } include the closing in the request length set request [string range $request 0 $req_len] incr req_len 4 Save the URI, port, version and headers if { not [regexp -nocase "^CONNECT (.+)(?::(\d+)) (HTTP/1\.[01])\r?\n(.*)$" $request -> uri port version headers] } { Not a proxy connect request, just release the data (could also reject the connection here using "reject") TCP::release return } if { $port != 443 } { Don't SSL terminate connect requests to non-443 ports SSL::disable } Remember that we found a "CONNECT" request set proxied 1 Remove the connect request header TCP::payload replace 0 $req_len {} If name resolution is needed on the uri use the NAME::lookup cmd like so: NAME::lookup [URI::host $uri] } when NAME_RESOLVED { Use the resolved uri's address node [NAME::response] $port TCP::release } when SERVER_CONNECTED { if { $proxied } { clientside { TCP::respond "$version 200 Connection Established\r\nProxy-Agent: BigIP v9\r\n\r\n" } } } }
- Stephan_MantheyHistoric F5 Accountthanks! will implement it asap and give feedback.
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