Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Certificate revocation and short lifetimes

After this lesson: I can explain why a short certificate lifetime limits a stolen key better than revocation does.

65 min lesson5 commandsCertificate automation lab: ACME, short-lived TLS certificates and automatic renewal with a private CA

A stolen key that still works

Certificate revocation is how a CA says a certificate must not be trusted before its end date, for example after its key was stolen. It only helps if the client checks, and many clients do not.

Short lifetimes are the other answer: a certificate that ends soon stops being useful to a thief soon.

By the end of this lesson

Note

I can explain why a short certificate lifetime limits a stolen key better than revocation does.

Key words

WordWhat it means
Revocationa CA saying a certificate must not be trusted
CRLa certificate revocation list the CA publishes
OCSPa service that answers whether one certificate is revoked
Soft failtrusting a certificate when the revocation check cannot be made
Exposurethe days a stolen key can still be used
Short-lived certificateone that lasts days, so revocation matters little

The cells students fill in are left blank in this preview.

How a certificate is revoked

The holder of the key, or the CA, asks for revocation and gives a reason code, such as 1 for key compromise. ACME has a revokeCert address for this.

The CA then lists the serial number in its CRL, or answers "revoked" over OCSP. Nothing changes in the certificate itself. Every client has to ask.

Get a certificate to revoke

Command
docker exec client step ca certificate client lost.crt lost.key --provisioner acme --standalone --force

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Revoke it as if its key was lost

Command
docker exec client step ca revoke --cert lost.crt --key lost.key

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

The CA says it is revoked

The Run printed Certificate with Serial Number and your own long number, then has been revoked. The step client proved it held the key by signing the request with it.

Now ask two questions. Does the certificate still check out? Will the CA renew it?

Does it still verify?

Command
docker exec client step certificate verify lost.crt --roots /ca/certs/root_ca.crt --verbose

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Will the CA renew it?

Command
docker exec client step ca renew lost.crt lost.key --force

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

What the two checks print

RunWhat it printedWhat it means
verifycertificate validated against roots, then certficiate is valid (step's own spelling)Signatures and dates still pass: nothing asked about revocation
renewThe request lacked necessary authorization to be completedThe CA remembers and refuses

The cells students fill in are left blank in this preview.

A common mistake

Warning

Many people think a revoked certificate stops working everywhere at once. It stops only for clients that check, and many skip the check or trust the certificate when the check fails. Its end date stops every client.

Why browsers rarely check

A revocation check is a network request on every new connection. It is slow, it tells the CA which sites you visit, and it can be blocked.

So most clients soft fail: when they cannot get an answer, they trust the certificate anyway. A thief who can block the check is never stopped by it.

Count the days a stolen key works

Command
docker exec python python3 steps/exposure.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Stolen on day 1, revoked on day 2

Lifetime in daysIf the client checksIf it does not
3981397
2001199
100199
47146
615

The cells students fill in are left blank in this preview.

A short life does revocation's job

When nobody checks, only the end date limits the damage. Cut the lifetime from 398 days to 47 and a thief's window falls from 397 days to 46.

This is one reason the rules for public certificates now shrink lifetimes step by step. A certificate of a few days hardly needs revoking at all, as long as renewal is automatic.

About this lab and its source: Certificate automation lab: ACME, short-lived TLS certificates and automatic renewal with a private CA

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.