Forum Discussion
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]]
}
}
Hi sgnormo ,
Please check this , it may help :
https://community.f5.com/t5/technical-forum/insert-common-name-value-to-http-header/td-p/111177
Regards- sgnormoCirrus
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]]
}
}
Recent Discussions
Related Content
* 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