Issuing, renewing, and revoking certificates
A certificate is only worth trusting while it is current and its private keyThe half of a key pair that its owner keeps to themselves and uses to create signatures or decrypt data. Anyone who obtains it can act as its owner. stays secret. Running one means asking a CA for it, proving the right to the names in it, replacing it before it expires, and withdrawing it when the key leaks. This lesson follows Harbor Clinic's certificate for its patient portal through each of those steps.
Requesting a certificate
Alex reads test results at portal.harborclinic.example, and staff sign in at login.harborclinic.example. Both names are served by one server, so the clinic wants one certificate that lists both. The work starts on the clinic's side, with a new key pairA private key and a public key generated together and mathematically linked. The private key creates signatures and the public key checks them, but the private key cannot practically be worked out from the public one.. The private key never leaves the clinic.
To ask a CA for a certificate, the clinic sends a certificate signing request (CSR), the request you met in Certificate authorities and chains. It holds the public keyThe half of a key pair that can be shared freely. It checks signatures made with the matching private key and can encrypt data that only that private key can decrypt. and the names the clinic wants, and it is signed with the private key, which shows the CA that the requester holds the key it is asking the CA to vouch for. With OpenSSL 3, one command can make both the key and the request:
openssl req -new -noenc \
-newkey ec -pkeyopt ec_paramgen_curve:P-256 \
-keyout portal.key -out portal.csr \
-subj "/CN=portal.harborclinic.example" \
-addext "subjectAltName=DNS:portal.harborclinic.example,DNS:login.harborclinic.example"-newkey ec with the P-256 curve makes a new elliptic curve key pair and writes the private half to portal.key. -subj sets the subject, and -addext asks for both names as subject alternative names, the field clients match against the hostname they wanted. -noenc writes the private key without a passphrase, so portal.key needs the protection described in Storing and using keys.
The signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message. on the request proves possession of the key and nothing else. Anyone can make a key pair and write any name into a request, so the CA's real decision comes next. In practice, most servers leave both steps to an automated client or to key hardware, which generate the key and request without anyone handling the file.
Proving control of a name
Before signing, the CA has to decide whether the clinic is entitled to the names in its request. This is the CA's version of identity proofingA process for establishing confidence that someone is the real person they claim to be, for example by checking identity documents and confirming that the evidence belongs to the person presenting it.. The claim is "we control portal.harborclinic.example," and for a domain-validated certificate the CA checks exactly that, much as a code mailed to an address checks who can collect mail there, as in Proofing methods.
Most automated clients talk to their CA with ACME, the Automatic Certificate Management Environment protocolAn agreed set of rules for the messages two systems exchange and what each message means. HTTP, OAuth 2.0, OpenID Connect and SAML are all protocols.. The client first registers an account with the CA, identified by a key pair of its own, the account key, which is separate from the portal's key. When the client asks for a certificate, the CA sends it a random tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. for each name. The client joins the token to a fingerprint of the account key, a hashTurning data into a short, fixed-size value called a hash, in a way that cannot be reversed and where changing one character changes the result completely. Services store password hashes instead of passwords, and signatures are made over a hash. of its public half like the thumbprints in Encoding and hashing, and the result is the key authorization. It then places that value where only the name's controller could. Because the account key is part of the answer, a check the clinic completes counts only for the clinic's account.
The HTTP-01 method serves the key authorization from the site itself, at a path ACME reserves. The CA fetches it over plain HTTP:
GET http://portal.harborclinic.example/.well-known/acme-challenge/Xr7kQ2pVn9sLd4mTzB8wHc1yJf6aGe3uNiK5oRtY0qE
HTTP/1.1 200 OK
Xr7kQ2pVn9sLd4mTzB8wHc1yJf6aGe3uNiK5oRtY0qE.Ub3nW8qTz5mKc2vLx9rJd7aHf4sGp1eYi6oNt0kRwBMThe path ends with the token, and the body is the token, a dot and the account key's fingerprint. The DNS-01 method publishes a base64urlA way of encoding data as ordinary text characters so it can travel safely in headers, URLs, and JSON. Anyone can decode it, so it hides nothing; Base64url is a variant safe for URLs, used in JWTs. SHA-256 hash of the key authorization as a TXT record under the name instead. It suits servers that the internet cannot reach, and it is the only method that can prove control of a wildcard name such as *.harborclinic.example:
_acme-challenge.portal.harborclinic.example. 300 IN TXT "hG7pL2sQv9dXcR4nTbW8yZ1mK5aE3fJ0uOiN6rYtS2c"If the CA finds the expected value, it issues the certificate. Like the mailed code, this shows control at the moment of the check, not a lasting truth. Anyone who takes over the clinic's DNS or web server, even briefly, can pass the same check. Two rules from the CA/Browser Forum narrow that opening. Since 2025, publicly trusted CAs must confirm each check from several network locations, so an attacker who hijacks the route to the clinic from one place does not fool them all. And the time a CA may reuse an earlier successful check is shrinking, to ten days by 2029, so a certificate reflects control confirmed recently.
The clinic can also limit who may issue at all. A CAA record, which you saw among the DNS record types in How names become addresses, names the CAs permitted to issue for the domain, and every other publicly trusted CA must refuse:
harborclinic.example. 3600 IN CAA 0 issue "ca.example"A certificate that includes an organization's name, not only domain names, needs more. The CA also validates the organization through registration records and contact checks, closer to the document and record checks the clinic itself uses for patients.
Renewing before expiry
Every certificate expires, and the Baseline Requirements cap the lifetime of publicly trusted certificates on a falling schedule: 398 days for certificates issued before 15 March 2026, 200 days from that date, 100 days from 15 March 2027, and 47 days from 15 March 2029. A shorter lifetime limits how long a mistaken or compromised certificate stays usable and makes revocation matter less. It also makes renewing by hand impractical.
An expired certificate is one of the most common causes of avoidable outages. Nothing is wrong with the portal except a date, yet every client refuses to connect, and Alex sees a browser warning instead of results. The reliable answer is automation. An ACME client on the clinic's server requests a new certificate when the current one has 30 days left, proves control of both names again, installs the result and reloads the server. Many clients make a fresh key pair at each renewal, so each key is used for a limited time.
The margin matters as much as the automation. Thirty days leaves time to notice a failed renewal and fix it while the old certificate still works. A margin longer than the certificate's whole lifetime would ask for renewal the moment a certificate arrived.
Automation also needs watching. The clinic keeps an inventory of its certificates and checks their expiry dates separately from the renewal client, so a renewal that fails quietly becomes an alert rather than an outage. Certificate Transparency monitoring, from Certificate authorities and chains, shows every certificate issued for its names, including any it did not ask for.
Revoking a certificate
Suppose a developer accidentally commits portal.key to a public code repository. Deleting the file does not help, because anyone could already have copied it. With the key and the public certificate, someone who can redirect traffic could impersonate the portal and read what patients send.
The clinic makes a new key pair, obtains a new certificate for the same names and deploys it. Then it asks the CA to revoke the old certificate, giving key compromise as the reason. The CA adds the certificate to its revocation list, and clients that check revocation stop accepting it. As Validating a certificate explained, many clients never check, which is one more reason short lifetimes matter. CAs also revoke certificates on their own when they discover they issued one incorrectly, or when the holder no longer controls the name.
The order and the new key both matter. Renewing with the leaked key would give the person holding the copy a fresh certificate too, and waiting for the old certificate to expire leaves the copied key usable until then.
30 days before expiry
- Key
- Fresh key pair
- Old certificate
- Expires on its date
- Clients
- Accept the new one
Copied keys age out
Replace, then revoke
- Key
- Fresh key pair
- Old certificate
- Revoked: key compromise
- Clients
- Checking clients refuse it
Copied key refused where checked
Wait for expiry
- Key
- portal.key, unchanged
- Old certificate
- Valid until it expires
- Clients
- Accept the copied key
Impersonation until the last day
Clients that skip revocation checks accept a revoked certificate until it expires.
A clinic that renews automatically is well placed for this. Replacing a certificate is already routine, so an emergency replacement uses the same process at an unplanned time.
Trust from end to end
Follow Alex's next visit to the portal. The browser validates the clinic's certificate against a root it trusts, and the server proves it holds the matching private key. Alex signs in with a passkeyA credential that your phone, computer or password manager creates for one website and keeps for you, unlocked with a fingerprint, face or PIN. Nothing you could type is sent, and it works only for the site it was made for, which helps it resist phishing. whose public key the portal stored at enrollment. The clinic's sign-in service signs a token with a key held in hardware, and the portal checks it against the clinic's published key setA JSON document, published at a fixed HTTPS address, that lists an issuer's current public keys so others can verify its signatures. It never contains private keys., fetched over the same kind of validated HTTPSHTTP protected by TLS, so traffic is encrypted and checked for changes while it travels. It protects the connection, but does not prove that the site at the other end is honest. connection. The results it shows were signed by the outside laboratory that ran Alex's tests.
Each of those steps rests on an earlier decision: the proofing that linked Alex's account to the right patient record, the enrollment that registered Alex's passkey, the CA's check of the clinic's domain, and the platform's choice of trusted roots. A certificate that expired unnoticed or a key that leaked without a replacement breaks the chain at that point, whatever the later steps get right.
Certificates can identify the other side of a connection too. In the mutual TLS from HTTPS and certificates in practice, an application that calls a service presents a client certificate and proves it holds the matching private key, so the service learns which application is calling. Client certificates follow the same lifecycle: a request signed with the application's key, a CA that decides whether to vouch for the name in it, renewal before expiry, and revocation when the key is exposed.
Organizations usually run their own CA for client certificates, because they are vouching for their own applications rather than for a public name. There is now a second reason. Root programs are moving publicly trusted certificates to server authentication only, so an application that must present a certificate needs one from a private CA. Authenticating a client with a certificate shows how an authorization server uses them.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Issue, renew and revoke a client certificate with the tenant's authorityMake a key and request, build the value a domain check looks for, have the tenant's teaching authority issue a certificate, then revoke it for key compromise and renew with a fresh key.