I've been following this tutorial to create a Root CA, intermediate CA, and server certificate.

I can verify:

  • the intermediate certificate with the root certificate
  • the server certificate with the intermediate certificate

But I can't verify the bundle intermediate cert + server cert with the root certificate.

In other words:

# verify intermediate cert with root cert: OK
openssl verify -CAfile root/certs/ca.cert.pem intermediate/certs/intermediate.cert.pem

# verify server cert with intermediate cert: OK
openssl verify -CAfile intermediate/certs/intermediate.cert.pem intermediate/certs/my.domain.cert.pem

# create bundle intermediate cert + server cert
cat intermediate/certs/my.domain.cert.pem intermediate/certs/intermediate.cert.pem  > certs/my.domain.bundle.pem

# checking bundle with the root cert: NOT OK
openssl verify -CAfile root/certs/ca.cert.pem intermediate/certs/my.domain.bundle.pem # NOT OK

That confuses me because I thought I would deploy the Root CA certificate on clients, and have the server use the bundle intermediate cert + server cert.

Does that mean I should only deploy the intermediate cert on clients, and have the server use only the server cert?


In general, a server must hand over the server certificate and the intermediate certificates. To quote RFC 5246 (emphasis mine):

If the server is authenticated, its certificate message must provide a valid certificate chain leading to an acceptable certificate authority.

It is preferred that the server do this, as opposed to distributing intermediates to all the clients, because trying to make sure all your clients get and keep the proper intermediates is a lot harder than handing them out each time as part of the handshake.

Echoing this setup, you should try, instead of using the bundle as your target, using the -untrusted argument to openssl verify to integrate the intermediates:

-untrusted file

A file of additional untrusted certificates (intermediate issuer CAs) used to construct a certificate chain from the subject certificate to a trust-anchor. The file should contain one or more certificates in PEM format. This option can be specified more than once to include untrusted certificates from multiple files.

| improve this answer | |

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.