Forum Discussion

ITZBund_177779's avatar
ITZBund_177779
Icon for Nimbostratus rankNimbostratus
Feb 06, 2018

HTTP-Header - insert client-cert -- blank at last?

I have a iRule like this:

when HTTP_REQUEST {
 check if there is a SSL certificate available
if { [SSL::cert count] > 0 } {
             insert this cert in PEM format to the (X-ENV-SSL_CLIENT_CERTIFICATE) HTTP Header
    HTTP::header insert "X-CLIENT-CERT" "[X509::whole [SSL::cert 0]]"
            }
}

It works fine. But now, the server-admin will upgrade the apache from 2.2 to 2.4. There is a mismatch at the End of the Header:

Do you know: is the blank a known Problem?

Thanks

2 Replies

  • To remove white space from the cert data use string trim command, that should make Apache a bit happier.

    e.g.

    [string trim [X509::whole [SSL::cert 0]]]
    
  • Hi,

    I do not think space can pose a problem, but it's depending how Apache will react and what it waiting for. So you confirm that your problem come from Apache? when it receive the cert inside the header...

    You can remove newline/space using this command;

    set clear_cert [findstr [string map {" " "" "\n" ""} [X509::whole [SSL::cert 0]]]
    

    Keep me in touch.

    regards