mardi 7 juillet 2015

Apache strips new line in header value

We have configured access to the web service as follow:

<LocationMatch "/(services/)UserService" >
    SSLRequireSSL
    SSLVerifyClient require
    SSLOptions +StrictRequire +ExportCertData +StdEnvVars
    SSLVerifyDepth 1
    RequestHeader set SSL_CLIENT_CERT %{SSL_CLIENT_CERT}e
</LocationMatch>

User, when accessing service, needs to represents itself with client certificate. When we try to read header value of user's client certificate with

headers.get(SSL_CLIENT_CERT).get(0)

we notice, that value of certificate does not have anymore new lines in the end of each row, but insted he have blank space.

Client cert should be something like:

-----BEGIN CERTIFICATE-----
user client certificate
with multiple lines
-----END CERTIFICATE-----

but we get it as

-----BEGIN CERTIFICATE----- user client certificate with multiple lines -----END CERTIFICATE-----

What do we do wrong, that apache doesn't by default send client certificate as a raw value, but he replaces newlines with blank space?

Aucun commentaire:

Enregistrer un commentaire