Forum Discussion

Mathew_58739's avatar
Mathew_58739
Icon for Nimbostratus rankNimbostratus
May 17, 2007

Insert SSL certificate name into HTTP header

I have a customer that wants the SSL certificate name instead of the ClientIP address re-inserted into the HTTP header. I need some help???

4 Replies

  • Check out this example in CodeShare

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/InsertCertInServerHeaders.html

     

    Click here

     

  • Ok. Thank you for the example. My rule is relatively simple then.... all I should need is:

     

    when HTTP_REQUEST {

     

    HTTP::header insert SSLClientCert

     

    } else {

     

    reject

     

    }

     

     

    Do you know what value I need for the SSLClientCert ? I want to be able to insert the client certificate name. For example, myserver.domain.com.
  • I have an updated rule to consider......

     

    when CLIENTSSL_CLIENTCERT {

     

    set sslcert_cn [SSL::cert 0]

     

    }

     

    when HTTP_REQUEST {

     

    HTTP::header insert ClientSSL $sslcert_cn

     

    }

     

    I don't know what value use in the [SSL::cert 0] location to ensure that I am capturing the Common Name. Can you help?
  • Take a look at the X509:: commands on the wiki (Click here).

     

     

    I think '[X509::subject [SSL::cert 0]]' should work, but I haven't tested it with a client cert.

     

     

    Aaron