Forum Discussion
AwesomeNetwork1
Aug 31, 2017Nimbostratus
capturing the CN from a X509 subject
I found irules for capturing the X509::subject, but I need to capture the CN and insert it into a http::header. It looks like I can do that with the subject. any idea on how (if possible) I can iso...
Stanislas_Piro2
Aug 31, 2017Cumulonimbus
Hi,
if you have the subject stored in variable subject, use the following code=
set subject_element [split $subject ","];
foreach value $subject_element {
if {[string first "CN=" $value] >=0} {
set CN [string range $value [expr {[string first "=" $value] +1}] end ];
break;
}
}
or
array set fields [split $subject ",="]
the CN is then stored in $fields(CN)
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