On Mon, Feb 27, 2006, Brian Candler wrote:

> I'm trying to get a client to verify a server certificate signed by a sub-CA
> when the client has only the root CA certificate.
> 
> I'm using TinyCA (GUI wrapper around OpenSSL) as the CA. Here's what I've
> done:
> 
> 1. Created a root CA (CN=root.ca.linnet.org)
> 2. Created a sub CA under this (CN=sub.ca.linnet.org)
> 3. Created a CSR and signed it by the sub CA
> 4. Installed the certificate in a small server
> 
>     #!/bin/sh
>     cd content
>     openssl s_server -cert ../server.example.com-cert.pem \
>       -key ../server.example.com-key.pem \
>       -CApath /etc/ssl/certs \
>       -WWW
> 
> 5. Installed the root CA's certificate under /etc/ssl/certs and re-ran
>    c_rehash to incorporate it.
> 
> However, when the client connects, it is not presented with a full
> certificate chain back to the root, but just the certificate signed by the
> subCA:
> 
>     $ openssl s_client -connect localhost:4433 -CApath /etc/ssl/certs 
> -showcerts
>     ...
>     ---
>     Certificate chain
>      0 s:/C=GB/L=London/O=Test server certificate/CN=server.example.com
>        i:/C=GB/L=London/O=Candler Insecure Certificate 
> Authority/CN=sub.ca.linnet.org/[EMAIL PROTECTED]
>     ---
> 
> As a result, even though the client has the root certificate available
> (CN=root.ca.linnet.org), it's unable to verify the certificate presented.
> 
> Somehow, I need to get the server to present a full certificate chain to the
> client.
> 
> I tried appending the sub CA's own certificate (signed by the root CA) to
> server.example.com-cert.pem, but that didn't make any difference. If I
> swapped the two around, so that the sub CA's certificate is first, then
> OpenSSL won't start:
> 
> $ ./server.sh
> Using default temp DH parameters
> Enter PEM pass phrase:
> unable to get private key from '../server.example.com-key.pem'
> 86322:error:0B080074:x509 certificate routines:X509_check_private_key:key 
> values 
> mismatch:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/x509/x509_cmp.c:389:
> 
> Anyway, it's not clear to me whether the certificate generated by TinyCA is
> incomplete, or whether there's some additional configuration required by the
> server to get it to send the chain. I'd be very grateful if someone could
> point me in the right direction.
> 
> The certificates and their decoding are attached below.
> 
> Regards,
> 
> Brian.
> 
> Here are the two certificates, which currently are appended together in
> server.example.com-cert.pem, although it seems only the first one is used.
> 
[snipped]

Since you didn't include the root CA it isn't possible to say why it isn't
excluded.

I notice the small serial numbers in the certificates and some invalid
extensions in there. I'd suggest using the CA.pl script (if you use OpenSSL
0.9.8 get it from a recent snapshot: the included one is buggy) instead.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to