Forum Discussion
mikegray_198028
Jan 20, 2017Cirrus
irule help
Hello Team,
I am looking for irule for the below scenario.
https://www.example.com/user1 > for this user will submit client certificate with cn=user1 LB should accept this connection and rej...
Stanislas_Piro2
Jan 23, 2017Cumulonimbus
Hi,
you can use this irule:
when CLIENTSSL_HANDSHAKE {
if {![info exists username]} {set username ""}
}
when CLIENTSSL_CLIENTCERT {
Check if client provided a cert
if { [SSL::cert count] > 0 } {
set username [regsub -all ".*CN=(.\[^,\]*),.*$" [X509::subject [SSL::cert 0]] {\1}]
}
}
when HTTP_REQUEST {
if {[HTTP::uri] equals /} {
HTTP::redirect "/$username"
}elseif { !([HTTP::uri] starts_with "/$username") } {
HTTP::respond 403 content {
Not authorized
You are not autorized to access this website
} noserver
}
}
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