mischa
1
When you need the client certificate on the real server:
`when CLIENTSSL_CLIENTCERT { set cert [SSL::cert 0] session add ssl [SSL::sessionid] $cert }
when HTTP_REQUEST { set cert [session lookup ssl [SSL::sessionid]] regsub -all {([\-]+(BEGIN|END) CERTIFICATE[\-]+)|\n} [X509::whole $cert] {} chdr HTTP::header insert CLIENT_CERT $chdr }`
mischa
2
Slightly modified version without the persistency table:
`when CLIENTSSL_CLIENTCERT { set cert [SSL::cert 0] }
when HTTP_REQUEST { regsub -all {([\-]+(BEGIN|END) CERTIFICATE[\-]+)|\n} [X509::whole $cert] {} chdr HTTP::header insert X-CLIENT-CERT $chdr }`
mischa
3
Other alternative when HTTP_REQUEST {
set cert [X509::whole [SSL::cert 0]]
regsub -all {\n|-----BEGIN CERTIFICATE-----|-----END CERTIFICATE-----} $cert "" newcert
HTTP::header insert "X-Client-SSL-Cert" $newcert }