Forum Discussion
Paul_Risk_10960
Nimbostratus
Sep 19, 2007Need to use the special character "$" in an HTTP header name?
Hi guys,
I need to pass the client cert in an HTTP header to the backend server. I have a working iRule that does this perfectly (from DevCentral :D ), however I need to call the HTTP header "$WSCC" and $ is obviosuly a special character. When I use the iRule below, I get this error in the logs (which I totally understand):
TCL error: Rule test_cert - can't read "WSCC": no such variable while xecuting "HTTP::header replace $WSCC [X509::whole $the_cert]"
So how can I define an HTTP header called "$WSCC" (without the quotes)?
This is the current iRule:
when CLIENTSSL_HANDSHAKE {
set cur [SSL::sessionid]
set ask [session lookup ssl $cur]
if { $ask eq "" } {
session add ssl [SSL::sessionid] [SSL::cert 0]
}
}
when HTTP_REQUEST {
set id [SSL::sessionid]
set the_cert [session lookup ssl $id]
if { $the_cert != ""}
{
HTTP::header replace $WSCC [X509::whole $the_cert]
log "Client cert is $the_cert"
}
else { log "no client cert found!" }
}
Thanks,
Risky.
- Paul_Risk_10960
Nimbostratus
So it appears the answer is simple. Just put a \ in front of the name - so in this case the iRule statement should read:
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