Forum Discussion
Tom_Lebel_53961
Jul 11, 2006Nimbostratus
Ok. Getting there. Now I am wondering if someone can explain why this is working? Can anyone give me a section by section explaination of this?
Also, I need to have it do an 'OR' in the if statement that looks at the URI, but the editor doesn't like my syntax. How do you do an OR in an IF statement? I need it to do this for /ASITE OR /BSITE.
when CLIENT_ACCEPTED {
set session_flag 0
}
when CLIENTSSL_HANDSHAKE {
log LOCAL0.warn "cert count=[SSL::cert count]"
if {[SSL::cert count] == 0 }
{
log LOCAL0.warn "when client handshake,ssl cert count is 0,pass"
}
else {log LOCAL0.warn "when clent handshake , two way cert found and the cert count is [SSL::cert count] "
HTTP::release}
log "Session flag is $session_flag"}
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/ASITE"}
{log "Requiring certificate...and the request uri is :[HTTP::uri]"
if {[SSL::cert count] == 0}
{
log local0. "when http request,ssl cert count is 0,now http collect"
HTTP::collect
SSL::authenticate always
SSL::authenticate depth 9
SSL::cert mode require
log local0. "when http request,now renegotiating"
set session_flag 1
SSL::renegotiate
}
}
else
{
log LOCAL0.warn "No cert needed,to server directly.And the uri is [HTTP::uri]" }
log "Session_flag at end of http_request is $session_flag"
}