Forum Discussion

Prakash_Jayaram's avatar
Prakash_Jayaram
Icon for Nimbostratus rankNimbostratus
Sep 29, 2015

How to retrive ssl client certificate from HTTP header

I have a scenario where actual ssl client certficate is already inserted inside the HTTP header. How can I make the F5 to look inside the HTTPheader for actual ssl client certificate?

 

3 Replies

  • Hello,

    According to SSL standard, client has to be present the authentication certificate during the SSL handshake. Your request would only be doable with an iRule solution. Even then, you will allow all clients to complete the SSL handshake, and decide to drop some of them who do not present the required HTTP header with a correct value. Essentially, you're building a L7 whitelist solution where client access rights are determined by the value of a HTTP header.

    To help you get started: The function to return the value of a particular HTTP header is

    [HTTP::header value {MyHeader}]

    when HTTP_REQUEST {
    
      log local0. "The value of HTTP header MyHeader is <[HTTP::header value {MyHeader}]>"
       Results are logged to /var/log/ltm. If the value is blank, the header was not found in client request.
    
    }
    

    Once you are at a point where you can see the actual certificates being logged to /var/log/ltm as the value of a HTTP header, I can help with the next step which is building a whitelist component of the iRule.

  • Hello Hannes Rapp,

     

    Thanks for your answer. I am able to see the certificate in header. how to take this certificate out from the header and decrypt it. How can I proceed further using it like a normal SSL::cert 0, etc..Please suggest.

     

    • Hannes_Rapp's avatar
      Hannes_Rapp
      Icon for Nimbostratus rankNimbostratus
      If you see the HTTP header, your traffic flow is already decrypted - you would not be able to access this information in case of encrypted traffic flow. This means your F5 offloads the SSL (completes the SSL handshake without authenticating the client). This header will not be used for traffic decryption at any point, but you can still use this information for client-authentication at the upper layer. Does this make sense? Based on your initial post, it seems like you want to create a client-authentication solution but you have the SSL client-certificate information in HTTP protocol information. Can you confirm this is what you're trying to acomplish or if there's a misunderstanding here?