Please concern the following setup: A client certificate is issued like this:
Root CA → Intermediate CA → Client Cert
Let's assume everything is fine up to here, the intermediate CA cert is properly signed by the root CA and the same for the client cert and the intermediate CA. The following files were produced:
root_ca.crt
(containing only the root CA cert)intermediate_ca.crt
(containing only the intermediate CA cert signed by the root CA)client.crt
(containing only the client cert, signed by the intermediate CA)client_key.pem
(containing the private key belonging to the client cert)ca_chain.pem
, containing (in this order) the intermediate CA cert and root CA certclient_ca_chain.pem
, containing (in this order) the client cert, intermediate CA cert and root CA cert
Calling openssl x509 -in client.crt -noout -purpose
gives:
Certificate purposes:
SSL client : Yes
SSL client CA : No
SSL server : No
SSL server CA : No
Netscape SSL server : No
Netscape SSL server CA : No
S/MIME signing : No
S/MIME signing CA : No
S/MIME encryption : No
S/MIME encryption CA : No
CRL signing : Yes
CRL signing CA : No
Any Purpose : Yes
Any Purpose CA : Yes
OCSP helper : Yes
OCSP helper CA : No
Time Stamp signing : No
Time Stamp signing CA : No
(I'm wondering a little about the CRL signing
, Any Purpose
and OCSP helper
flags, but as I understood, they're OK and I can't get rid of them.)
Now, having configured an nginx server like this:
#...
ssl_client_certificate /path/to/ca_chain.pem;
ssl_verify_client on;
ssl_verify_depth 2;
#...
I will always get an error 400 and the following message when trying to access the site: client SSL certificate verify error: (26:unsupported certificate purpose) while reading client request headers
.
(I can quickly reproduce this using curl --cert /path/to/client_ca_chain.pem --key /path/to/client_key.pem --cacert /path/to/ca_chain.pem -k https://${myUrl}
or less quickly using a gui browser.)
I have spent some hours trying to figure out what the problem is here, but I can't and also searching the web for it didn't bring me further. So I would greatly appreciate any help!