Forum Discussion
Stephen_Archer_
Apr 28, 2008Historic F5 Account
CLIENTSSL_HANDSHAKE event not triggered...?
I'm trying to create an iRule to authenticate user requests using SSL auth, but only when a specific URI is used. The iRule posted below is a simplified version of my 'full' iRule - and I get the same problem when using the simplified version too.
In short, when I attempt a connection to this VIP using the /secure_uri, the LTM prompts my browser for a client cert, which I present. However, when i check the logs on the LTM, the "Client cert is OK; releasing HTTP request." message is never logged, so I assume that after the 'SSL::renegotiate' the CLIENTSSL_HANDSHAKE event is never triggered...? Anyone have any clue why this is? I'm probably being stupid... but that's your reward for figuring this out... call me stupid ;-)
Thanks in advance.
when CLIENTSSL_HANDSHAKE {
if { [SSL::cert count] != 0 } {
log "Client cert is OK; releasing HTTP request."
HTTP::release
pool pool_X_443
}
}
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/secure_uri" } {
log "Certificate required for: [HTTP::uri]"
if { [SSL::cert count] == 0} {
log "No cert found. Holding HTTP request until a client cert is presented..."
HTTP::collect
set session_flag 1
SSL::authenticate always
SSL::authenticate depth 9
SSL::cert mode require
SSL::renegotiate
}
}
else {
log "No certificate needed for: [HTTP::uri]"
SSL::disable serverside
pool pool_Y_80
}
}
- Colin_Walker_12Historic F5 AccountHave you tried moving the log statement outside of the if brackets? It might clear up whether or not it's an issue with the event firing, or your if comparison not being met...
- Stephen_Archer_Historic F5 AccountThanks for the advice. I tried moving the log statement as you suggested and it proves that the CLIENTSSL_HANDSHAKE event is not triggered. I also added a log statement immediately after the 'SSL::renegotiate'. I now see the following in the logs:
- Colin_Walker_12Historic F5 AccountThat's pretty interesting. You're not seeing the CLIENTSSL_HANDSHAKE event occurring even after the renegotiate command fires? Have you tried switching that to a CLIENTSSL_CLIENTCERT event to see if a cert is being added to the cert chain at all? It could be that the handshake is failing for some reason, but that seems odd.
- Stephen_Archer_Historic F5 AccountHi Colin, I've tried your suggestion, and moved forward somewhat now. The problem I'm now having is that if I set the ClientSSL Profile to 'request' or 'require' client cert, it works for the 'secure' URI's. However, it also requests a cert for the 'insecure' URI's - but we do not want 'insecure' users prompted for a cert at all. If I set the ClientSSL Profile to 'ignore' then neither the 'secure' URI's or the 'insecure' URI's work.
- xunil321_122934
Nimbostratus
@Stephen:
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