Forum Discussion
Leszek_Majewsk1
Nimbostratus
Nov 19, 2007how to pass variables
why I cannot read stored variables from the previous context ?
example:
when CLIENTSSL_CLIENTCERT {
set cert [SSL::cert 0]
set status [X509::verify_cert_error_string [SSL::verify_result]]
set subject [X509::subject $cert]
set serial [X509::serial_number $cert]
set issuer [X509::issuer $cert]
set values [list $cert $status $subject $serial]
set locality "Warszawa"
set count [SSL::cert count]
session add ssl [SSL::sessionid] $values 3600
log "Client handshake status: $status, serial number: $serial"
log "subject: $subject"
log "issuer: $issuer"
log "count: $count"
HTTP::release
}
In this section I store subject and issuer variables (I can see them in the log file)
the next context in my script is:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/pattern/" } {
set cert [SSL::cert 1]
set status [X509::verify_cert_error_string [SSL::verify_result]]
log "status jest: $status"
set subject [X509::subject $cert]
set serial [X509::serial_number $cert]
set issuer [X509::issuer $cert]
set values [list $cert $status $subject $serial]
set locality "Warszawa"
set count [SSL::cert count]
session add ssl [SSL::sessionid] $values 3600
log "Client handshake status: $status, serial number: $serial"
log "subject: $subject"
log "issuer: $issuer"
log "count: $count" ..... (!)
I have an error related to the line set subject [X509::subject $cert] and I cannot read previously stored variables such as subject. I thought that the script is running line by line.. what is wrong? hot to use the variables stored in the previous context ???
- hoolio
Cirrostratus
Are you getting the TCL error from the CLIENTSSL_CLIENTCERT event, where you set the subject variable, or the HTTP_REQUEST event? I would guess the latter event. You're setting the cert variable to the second cert in the request. Are there two certs? What do you see for the log statement with [SSL::cert count]? - Leszek_Majewsk1
Nimbostratus
Hi, - hoolio
Cirrostratus
The error seems odd... the setting of the variable looks fine. Checking SOL5171 (Click here) and this post (Click here), and this codeshare example (Click here), I don't see a problem. What version are you running? - Stanley_Leszczy
Nimbostratus
I contacted support about this exact issue and they said SOL5171 is wrong and needs to be updated. They are currently researching. If interested I wrote an iRule that seems to be working (at least for our applications): - hoolio
Cirrostratus
Hi leszcs, - Stanley_Leszczy
Nimbostratus
Case is still open - will update this thread once I hear something.
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