Forum Discussion
IRONMAN
Cirrostratus
Aug 30, 2019HTTP header insert with CN and for SHA1 thumbprint of the SSL certificate ?
Hi Any one help to edit the below irule to match my requirement, HTTP header insert with CN(Certificate name) and for SHA1 thumbprint of the SSL certificate to backend servers. LTM VIP is HTTPS w...
Andy_McGrath
Cumulonimbus
Aug 30, 2019when CLIENTSSL_CLIENTCERT priority 100 {
if {[SSL::cert count] > 0} {
set clientCert [X509::whole [SSL::cert 0]]
set clientCertSubject [X509::subject [SSL::cert 0]]
set clientCertHash [X509::hash [SSL::cert 0]]
foreach field [ split $clientCertSubject ","] {
if {$field starts_with "CN="} {
set clientCommonName [getfield $field "=" 2]
}
}
}
}
when HTTP_REQUEST {
if {(info exists clientCert) && ($clientCert ne "")} {
HTTP::header insert X-Client-Cert $clientCert
}
if {(info exists clientCommonName) && ($clientCommonName ne "")} {
HTTP::header insert X-Client-CN $clientCommonName
}
if {(info exists clientCertHash) && ($clientCertHash ne "")} {
HTTP::header insert X-Client-hash $clientCertHash
}
}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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