Ron_Kim_110696
Jan 11, 2007Nimbostratus
iRule example to extract specific X509 information: SOL5171
I can't get this iRule to work.
The variable $sn in the HTTP_REQUEST section does not have a value.
It is working in the CLIENTSSL_CLIENTCERT section.
Variables do not seem to pass from the CLIENTSSL_CLIENTCERT to the HTTP_REQUEST sections.
================
iRule example to extract specific X509 information: SOL5171
In the following example, a variable value is set using an SSL command to identify the X509 certificate. Once the X509 certificate is identified, another variable value is set using an X509 command to extract the certificate serial number. The client certificate's serial number is then inserted into an HTTP header with the name Serial.
when CLIENTSSL_CLIENTCERT {
set cert [SSL::cert 0]
set sn [X509::serial_number $cert]
}
when HTTP_REQUEST {
if { [info exists sn] } {
HTTP::header insert Serial $sn
}
}