Forum Discussion
Goran_Blomquis1
Nimbostratus
Mar 26, 2009Set ssl to require and pass cert when uri /manual
Hi devcentral
I try to write a I-rule that change ignore to require in SSLclient profile. I think Iḿ on the right track, but backend seems to be very slow and ask for cert all the time. I see in log that cert info are passed to backend when /manual is in URI.
when CLIENTSSL_HANDSHAKE {
if { [SSL::cert count] > 0 }{
set cur [SSL::sessionid]
set ask [session lookup ssl $cur]
if { $ask eq "" } {
session add ssl [SSL::sessionid] [SSL::cert 0]
HTTP::release
}
}
}
when HTTP_REQUEST {
set requestcertificatepage_uri [string tolower [HTTP::uri]]
log local5. "vilken uri [HTTP::uri]"
if {$requestcertificatepage_uri contains "/manual"} {
if {[SSL::cert count] == 0} {
HTTP::collect
SSL::authenticate always
SSL::authenticate depth 9
SSL::cert mode require
SSL::renegotiate
set id [SSL::sessionid]
set the_cert [session lookup ssl $id]
if { $the_cert != ""} {
HTTP::header replace X-Client-Cert [b64encode $the_cert]
log local5. "putt clientcert in header [b64encode $the_cert]"
}
}
}
}
Have a greate day
- linjing
Employee
what is result? - Goran_Blomquis1
Nimbostratus
Hi, - hoolio
Cirrostratus
That example wouldn't work well for clients who try to resume an existing SSL session. You would want to store the SSL session ID in the session table and then check on new requests if the current SSL session ID has a corresponding entry in the session table before checking if there is a cert.Force renegotiation of the SSL connection with a cert requested SSL::session invalidate SSL::authenticate always SSL::authenticate depth 9 SSL::cert mode require SSL::renegotiate
- Goran_Blomquis1
Nimbostratus
Thank you Aaron, I appreciate your input. I need to check how the final I-rule look. I get back! :-) - linjing
Employee
Posted By hoolio on 10/15/2009 4:33 AM
Force renegotiation of the SSL connection with a cert requested SSL::session invalidate SSL::authenticate always SSL::authenticate depth 9 SSL::cert mode require SSL::renegotiate
- hoolio
Cirrostratus
That's a good point. F5's answer was to create a hotfix (CR125264) which allows use of HTTP::respond in the CLIENTSSL_HANDSHAKE event. The hotfix is built for 9.4.8 and might be available for 10.x as well. You can contact F5 Support to request this fix.
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