0

I'm running Apache 2.2 on Windows, and have mod_ssl working fine for delivering a commercially signed server cert. (A wildcard cert, though I don't think it matters.)

I'm trying to get the server, on certain VirtualHosts, to require a client certificate, so I've built an SSLCACertificateFile containing PEMs; as I understand it, that list of signing DNs should be proffered for the client to respond during SSL establishment.

I have a StartSSL personal identity certificate, and if I put StartSSL's root cert into the SSLCACertificateFile, the browser (Chrome and IE tested) pops up "select a certificate" and shows me my StartSSL certificate.

However, my real use case is to use my own CA, and sign client certs, and that's what I can't get working. I self-sign a CA, then I create a client CSR and sign it with the CA cert and load it in my client cert store, then I put the CA PEM into my SSLCACertificateFile -- and the browser doesn't offer the client cert in the "select a certificate".

WTF.

Because it all works with the StartSSL CA and cert, I'm wondering if it's actually an issue with my CA cert or client cert -- but I can't figure out what the issue might be; the CA cert works for signing, and has CA:TRUE; the client certs have Client Authentication as a purpose... what's missing.

Not sure how to diagnose; thanks.

Here's my CA PEM, as pasted into the SSLCACertificateFile:

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            bf:45:a7:db:f9:8e:8f:d0
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: C=US, ST=California, L=San Diego, O=TestCA, OU=TestCA-OU, CN=TestCA-CN
        Validity
            Not Before: Mar  8 21:39:52 2013 GMT
            Not After : Apr  7 21:39:52 2013 GMT
        Subject: C=US, ST=California, L=San Diego, O=TestCA, OU=TestCA-OU, CN=TestCA-CN
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (2048 bit)
                Modulus (2048 bit):
                    <snip>
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                5E:99:47:8A:52:D3:38:20:68:A5:91:D9:E1:2E:6B:50:0D:5C:98:CB
            X509v3 Authority Key Identifier:
                keyid:5E:99:47:8A:52:D3:38:20:68:A5:91:D9:E1:2E:6B:50:0D:5C:98:CB

            X509v3 Basic Constraints:
                CA:TRUE

Signature Algorithm: sha1WithRSAEncryption
<snip>

...and here's the client cert:

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 20481 (0x5001)
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: C=US, ST=California, L=San Diego, O=TestCA, OU=TestCA-OU, CN=TestCA-CN
        Validity
            Not Before: Mar  8 23:46:55 2013 GMT
            Not After : Mar  8 23:46:55 2014 GMT
        Subject: C=US, ST=California, L=San Diego, O=TestClient, OU=TestClient-OU, CN=TestClient-CN
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (2048 bit)
                Modulus (2048 bit):
                    <snip>
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Key Usage:
                Key Encipherment
            X509v3 Extended Key Usage:
                TLS Web Client Authentication
    Signature Algorithm: sha1WithRSAEncryption
<snip>

/*******************************************************************/

Further info per Mike's request (took me a couple of tries to get 'openssl s_client' behaving.)

Here's the results: [...]

---
Acceptable client certificate CA names
/C=UK/O=Test Certificates/CN=Test CA
/C=US/ST=California/L=San Diego/O=TestCA/OU=TestCA-OU/CN=TestCA-CN
/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certific
ation Authority
---

[...]

So, the server is saying

/C=US/ST=California/L=San Diego/O=TestCA/OU=TestCA-OU/CN=TestCA-CN

is an acceptable client certificate, and the client has

Issuer: C=US, ST=California, L=San Diego, O=TestCA, OU=TestCA-OU, CN=TestCA-CN

in it's store -- but the browser doesn't include that in the list I can pick from. The browser does offer the client certs signed by

/C=UK/O=Test Certificates/CN=Test CA

and

/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority

...bringing me back to "WTF?"

  • I've submitted an edit that runs your certs through a openssl x509 -text filter. Saves people the trouble of doing it themselves. (might take a moment to clear peer review) – Andrew B Mar 9 '13 at 0:26
  • Thanks; I almost did that, but in some of the threads I was reading, the style seemed to be to post the raw PEM. – lairdb Mar 9 '13 at 0:29
  • Hopefully I'm not stepping on any toes then. These will still be available in the revision history if needed. – Andrew B Mar 9 '13 at 0:31
  • I wouldn't think so -- I just figured without the "source code" people might wonder if that was an issue. – lairdb Mar 9 '13 at 0:33
  • Does the client trust your self-signed CA? – mpontillo Mar 9 '13 at 1:07
1

Yes, I'm answering my own question.

Solved.

Turns out that KeyUsage keyEncipherment is NOT the correct keyUsage for an SSL/TLS client. The correct KeyUsage constraint is KeyUsage digitalSignature; useful info was found at this Mozilla article.

| improve this answer | |
  • Interesting; I just checked a cert I use for client SSL authentication, and its key usage field indeed matches this requirement. (It's using Digital Signature, Non Repudiation, Key Encipherment.) – mpontillo Mar 18 '13 at 5:00
  • One other note. The fact that the openssl returned 3 acceptable CAs raises a red flag for me. (You might want to double-check that this isn't a security risk?) – mpontillo Mar 18 '13 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.