Forum Discussion
eric_haupt1
Nimbostratus
Sep 06, 2017Client Certificate - Regex to parse numbers from cert subject
I've been using an irule from Devcentral for quite some time to parse the othername:UPN x509 field from our client certificates for APM use. However, our clients are provided two certs and one of th...
Stanislas_Piro2
Cumulonimbus
Sep 07, 2017Hi,
you can do it without an irule event (what is not optimal usage or APM) but with the following expression in
variable assign
set extension [mcget {session.ssl.cert.x509extension}];
if {[set tempupn [string range $extension [expr {[string first "othername:UPN<" $extension] +14}] [expr {[string last ">" $extension] -1}] ]] != ""} {
return $tempupn;
} elseif {[regexp {\d{10,16}} [mcget {session.ssl.cert.subject}] tempiv]} {
return "$tempiv@company";
}
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
