Forum Discussion

zafer's avatar
zafer
Icon for Nimbostratus rankNimbostratus
Dec 24, 2009

subject alternative name

Hello

 

 

i try to get subject alternative name from ssl certificate with this syntax but i see empty value in log file.

 

 

how can i get subject alternative name from ssl certificate?

 

 

when CLIENTSSL_CLIENTCERT {

 

set cert [SSL::cert 0]

 

session add ssl [SSL::sessionid] $cert 600

 

set sn [X509::serial_number $cert]

 

set issuer [X509::issuer $cert]

 

set subject [X509::subject $cert]

 

set not_valid_after [X509::not_valid_after $cert]

 

set not_valid_before [X509::not_valid_before $cert]

 

set san [substr [findstr [findstr [X509::extensions $cert] "X509v3 Subject Alternative Name:" 33 "\n"] "email:" 6 ,] 0 @]

 

}

 

 

 

 

regards

 

zafer

 

2 Replies

  • Hi Zafer,

     

     

    If you log the value for [X509::extensions $cert] do you see the SAN there? If so, can you post an anonymized copy of the output?

     

     

    Thanks,

     

    Aaron
  • AEisiminger_192's avatar
    AEisiminger_192
    Historic F5 Account
    Just in case anyone else runs into this like I did here is the correct code to pull Subject Alternative Name.

     

     

    SUBJECT ATERNATIVE NAME

     

    set santemp [findstr [X509::extensions $c_cert] "Subject Alternative Name" 32 ","]

     

    set san [findstr $santemp "email" 6]