Forum Discussion

bmarch_127138's avatar
bmarch_127138
Historic F5 Account
Nov 29, 2005

Spaces for line breaks when inserting client cert into header

Question:

 

 

When using the following rule to insert a client certificate into the http header, it puts spaces where line breaks occur within the certificate.

 

 

Is it possible to prevent this have have it inserted as one continuous stream of characters?

 

 

Rule:

 

 

when CLIENTSSL_CLIENTCERT {

 

set ssl_cert [SSL::cert 0]

 

session add ssl [SSL::sessionid] $ssl_cert 180

 

}

 

when HTTP_REQUEST {

 

set client_cert [session lookup ssl [SSL::sessionid]]

 

HTTP::header insert SSLClientCert [X509::whole $client_cert]

 

}

 

 

 

Unable to paste the output as this window formats it. But when viewed within the packet itself, wherever a line break occurs in the certificate, it is replaced with a space.

 

 

Causing end system that reads the information to fail because of the spaces. It is expecting a stream with no breaks.
  • Hi,

     

     

     

    I use something like this:

     

     

    when HTTP_REQUEST {

     

    set client_cert [session lookup ssl [SSL::sessionid]]

     

    HTTP::header insert SSLClientCert [ join [string trim [string map { "-----BEGIN CERTIFICATE-----" "" "-----END CERTIFICATE-----" ""} [X509::whole $client_cert] ]] "" ]

     

    }