Squeak_117117
Jun 16, 2017Nimbostratus
Insert client certificate into APM session variable via IRule
Hello!
First time poster longtime reader.
I´m trying to extract the Subject value from a client certificate and insert the value in to a APM session variable but with no luck. The Irule in question looks like this
when CLIENTSSL_CLIENTCERT {
log local0. "Subject: [X509::subject [SSL::cert 0]]"
if {[SSL::cert count] > 0}{
set client_cert [SSL::cert 0]
set subject [findstr [X509::subject [SSL::cert 0]] "CN=" 3 ","]
ACCESS::session data set session.client.unique_id $subject
log local0. "Current ID = $subject"
}
}
when ACCESS_POLICY_COMPLETED {
set subject [ACCESS::session data get session.client.unique_id]
}
I´m able to see the subject" variable in /var/log
When I´m executing the Access Policy, the session.client.unique_id variable are not populated with the subject" variable from the Irule.
My VPE looks like this,
Thanks in advance!
//Mikael,