Revocation: CRL and OCSP¶
Sometimes a certificate must stop being trusted before it expires. For example, its private key was stolen, or the server it was issued for was retired. You then revoke the certificate.
Other systems learn which certificates are revoked in one of two ways. Each authority can offer both. Both are turned off by default.
| CRL (certificate revocation list) | OCSP (online certificate status protocol) | |
|---|---|---|
| What clients get | A list of all the revoked certificates of one intermediate CA, signed by that CA. | The status of one certificate, signed by the authority's OCSP responder. |
| Its address | http://<domain>/authorities/<authority ID>/crl/<issuer ID> |
http://<domain>/authorities/<authority ID>/ocsp |
| How clients find the address | The certificate's CRL distribution point extension. | The certificate's authority information access (AIA) extension. |
| How long clients may keep an answer | The CRL validity setting. By default, 24 hours. | The OCSP response validity setting. By default, 1 hour. |
The addresses use plain HTTP on purpose. See Why BastionXP also listens on HTTP. They are also available over HTTPS.
You do not have to build the addresses yourself. The authority's page in Authority Manager shows them under Revocation status, with a button to copy each one.
Turn them on¶
When you create an authority in the portal, tick Enable OCSP responder and Enable CRL distribution.
To turn them on for an authority that exists, open the authority in Authority Manager. In Settings, turn on OCSP responder and CRL distribution, and choose Save settings.
The two validity settings tell clients how long they may keep an answer before they ask again:
| Setting | What it means | Default |
|---|---|---|
| OCSP response validity | How long each OCSP answer is valid, for example 4h. |
1 hour |
| CRL validity | How long each CRL is valid, for example 24h. |
24 hours |
For OCSP in production, RFC 5019 recommends 4 hours.
Turn revocation on before you issue certificates
A certificate contains the CRL and OCSP addresses only if revocation was turned on when the certificate was issued. Certificates issued earlier do not contain the addresses, so their clients cannot check whether they are revoked.
The CRL is signed by the authority's intermediate CA. The OCSP answers are signed by an OCSP responder certificate. The authority's intermediate CA issues that certificate, and it is valid for a year.
Each intermediate CA has its own CRL. When you rotate an authority, the old intermediate CA goes on publishing its CRL, for its own certificates, until the last of them has ended.
Check a certificate¶
To check a certificate with OCSP:
openssl ocsp -issuer intermediate.crt -cert web1.example.com.crt \
-url http://ca.example.com/authorities/servers/ocsp -resp_text
To download and read the CRL, use the address from Revocation status:
curl -so servers.crl http://ca.example.com/authorities/servers/crl/<issuer ID>
openssl crl -inform DER -in servers.crl -noout -text
Revoke a certificate¶
In the portal¶
An administrator can revoke any certificate in the portal:
- On the Devices page, open the device, and choose Revoke on its certificate. See Revoke a certificate of a device.
- On the Certificates page, open the certificate, and choose Revoke. See Certificates.
The portal asks for a reason, which is required. Revocation is permanent.
With an ACME client¶
Certificates issued over ACME can also be revoked with an ACME client. The client signs the revocation request either with the certificate's private key, or with the ACME account that ordered the certificate. For example:
sudo bxp-cli acme revoke --acme-id servers --reason key-compromise
sudo certbot revoke --cert-path /etc/letsencrypt/live/web1.example.com/cert.pem \
--server https://ca.example.com/authorities/servers/acme/servers/directory
As soon as a certificate is revoked, the CRL lists it, and OCSP answers that it is revoked.
Revocation reasons
You give a reason when you revoke a certificate. In the portal, you choose it from a list. With bxp-cli, use --reason. With certbot, use --reason, too. BastionXP stores the reason with the certificate and records it in the audit log. The CRL lists the reason for each revoked certificate, and the OCSP answers include it. When no reason is given, the reason is unspecified. The reasons bxp-cli accepts are listed on the bxp-cli acme page.
Revoke a CA¶
If the key of a CA may have been stolen, revoke the CA itself. That revokes every certificate that it issued. See Revoke a CA after a compromise.
A revoked CA is listed in a different list from a revoked certificate. A CRL lists the revoked certificates of one intermediate CA, and the intermediate CA signs it. The authority revocation list (ARL) lists the revoked intermediate CAs, and the root CA signs it. BastionXP publishes the ARL at a stable address on its plain HTTP port, and names that address in the intermediate CA certificates it makes. See Certificate lifecycle.
