Forum Discussion

sgnormo's avatar
sgnormo
Icon for Cirrus rankCirrus
Nov 08, 2022

iRule header insert

I am using an iRule to perform a header insert of the user common name.  Now the request is that if a user clicks cancel when prompted for a certificate that the user still get to the web server splash page.  I am a weak iRule writer, so I am kindly asking for help in modifying the iRule so that if user clicks cancels the iRule does not cause connection error for the user's that click cancel at the certificate prompt.

 

when CLIENTSSL_CLIENTCERT {
if {[SSL::cert 0] ne ""} {
#log local0. "Client cert subject: [X509::subject [SSL::cert 0]]"
set client_subject [X509::subject [SSL::cert 0]]
# set client_cn [findstr $client_subject "CN=" 3 ","]
}
}
when HTTP_REQUEST_SEND {
# log local0. "In request send section $client_subject"
clientside {
HTTP::header insert X-Client-Cert [X509::subject [SSL::cert 0]]
}
}

  • that pointer gave me what i needed  thank you.

    when CLIENTSSL_CLIENTCERT {
    if {[SSL::cert 0] ne ""} {
    #log local0. "Client cert subject: [X509::subject [SSL::cert 0]]"
    set client_subject [X509::subject [SSL::cert 0]]

    }
    }
    when HTTP_REQUEST {
    if {[info exists client_subject]} {
    HTTP::header insert X-Client-Cert [X509::subject [SSL::cert 0]]
    }
    }