SBN

How to Verify Full TLS Certificate Chains Against CRLs via OpenSSL CLI

As in the last days many CA’s revoked certificates because not getting hacked, but the written policy did not match 100% the certificates. As the CAB Forum (Browser Vendors) enforce a strict compliance they needed to revoke the certs. And one of the problems is/was that Chrome have its own CRL System and does not check the CA CRLs you may not check that your certificates got revoked so you may not notice that clients which check the CRLs block the access (like Firefox). So we need a solution for this which can also be used in scripts.

When validating TLS certificates, simply checking if a cert is expired isn’t enough—you also need to confirm that no certificate in the trust chain has been revoked. While curl requires you to download Certificate Revocation Lists (CRLs) manually beforehand, OpenSSL can fetch and evaluate them automatically during the handshake.

Here is the single command to connect to a TLS server and verify the entire certificate chain against live CRLs:

openssl s_client -connect example.com:443 -servername example.com -crl_check_all -crl_download < /dev/null

What’s Happening Under the Hood?

  • crl_download: Instructs OpenSSL to parse the CRL Distribution Points embedded inside the certificates and dynamically fetch the CRL files over HTTP.
  • crl_check_all: Enforces revocation checks across every level of the chain (leaf cert, intermediate CAs, and root). Use -crl_check if you only want to validate the leaf certificate.
  • servername example.com: Passes the Server Name Indication (SNI) header so multi-tenant hostings return the correct certificate.

Example

This example shows the first lines of the OpenSSL output which show that the server certificate is revoked. The entry with the root CA is ok, as a root CA does not have a CRL.

Connecting to xxxxxxx
CONNECTED(00000003)
depth=0 C=AT, ST=Wien, O=xxxxxxx, CN=xxxxxxxxx
verify error:num=23:certificate revoked
verify return:1
depth=2 C=GR, O=Hellenic Academic and Research Institutions CA, CN=HARICA TLS RSA Root CA 2021
verify error:num=3:unable to get certificate CRL
verify return:1
depth=2 C=GR, O=Hellenic Academic and Research Institutions CA, CN=HARICA TLS RSA Root CA 2021
verify return:1
depth=1 C=GR, O=Hellenic Academic and Research Institutions CA, CN=GEANT TLS RSA 1
verify return:1
depth=0 C=AT, ST=Wien, O=xxxxxxx, CN=xxxxxx
verify return:1

The post How to Verify Full TLS Certificate Chains Against CRLs via OpenSSL CLI first appeared on Robert Penz Blog.

The post How to Verify Full TLS Certificate Chains Against CRLs via OpenSSL CLI appeared first on Robert Penz Blog.