Forum Discussion
Ed_Vitale_28327
Nimbostratus
Nov 18, 2005uri scheme
What is the best way to extract the uri scheme (http(s))?
im using ssl on nonstandard ports and need to pass the protocol back to the app in with a header insert.
https://app-a.foo.com:8080 or http://app-b.foo.com
header insert required is
HTTP::header insert BIG-IP-PROTOCOL [???]
Thanks
Ed
ps: im a newbie.
7 Replies
- JRahm
Admin
I think you're looking [TCP::local_port] - Ed_Vitale_28327
Nimbostratus
tcp local port provides the incoming port used,
but not the uri scheme.
wont tell me if its http or https. - JRahm
Admin
Sorry, misunderstood your question. Check out this post:
http://devcentral.f5.com/Default.aspx?tabid=28&view=topic&forumid=5&postid=1258 Click here - JRahm
Admin
You could also do a TCP::collect and look for the various SSL handshake signatures immediately following the TCP header:
0x010002 (SSL version 2)
0x160300 (SSL version 3)
0x160301 (TLS version 1)
My captures show SSLv2 signature at tcp offset 23 and SSLv3/TLSv1 signatures at tcp offset 21
HTH - unRuleY_95363Historic F5 AccountAssuming you are terminating the SSL on the BIGIP (which you must be since you are inserting an HTTP header), you can also do something like:
when HTTP_REQUEST { if {[catch {PROFILE::clientssl mode}] == 0} { set scheme HTTPS } else { set scheme HTTP } HTTP::header insert BIGIP-PROTOCOL $scheme }
This sets the scheme variable based on whether or not a clientssl profile is configured on the current virtual. - Ed_Vitale_28327
Nimbostratus
Thanks much citizen_elah for your help.
I will also try this approach.
-ed - Ed_Vitale_28327
Nimbostratus
Thanks unRuleY.
That worked our very well for me.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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