Forum Discussion
ekanathdas_2662
May 07, 2012Nimbostratus
We need to create an iRule that can verify client's certificate by checking the Subject line contains "CN=ABCD".
Hi team, I was looking out for an irule which can check client's certificate by checking the Subject line if it contains "CN=ABCD". I had referred to the below site: https://devcentr...
hooleylist
May 07, 2012Cirrostratus
That looks good. Make sure to check that there is a cert before trying to parse it as you'll get a runtime error and TCP reset if you don't and the client doesn't present a client cert in the handshake.
when CLIENTSSL_CLIENTCERT {
if {[SSL::cert count] > 0}{
set cert [SSL::cert 0]
set subject [string tolower [X509::subject $cert]]
set clientIP [IP::client_addr]
if { $subject contains "cn=abcd.com" } {
pool abcd } {
log local0. "cert CN valid" }
else {
log $clientIP
log local0. "cert CN not valid"
reject
}
}
}
Aaron
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