Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Issuing, renewing, and revoking certificates

A certificate is only worth trusting while it is current and its private key 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 pair. 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 key 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 signature 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 proofing. 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 protocol. 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 token for each name. The client joins the token to a fingerprint of the account key, 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.Ub3nW8qTz5mKc2vLx9rJd7aHf4sGp1eYi6oNt0kRwBM

The 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 base64url 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 routine renewal and a replacement after the key leaks both end with a new key. Waiting for expiry leaves the copied key accepted until the certificate's last day.

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 passkey 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 set, fetched over the same kind of validated HTTPS 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.

A CA asks the clinic to publish a TXT record under _acme-challenge.portal.harborclinic.example, and the clinic does. What has the CA learned? 1 of 3

Choose one answer.

The portal's private key appears in a public code repository. What should the clinic do? 2 of 3

Choose one answer.

The clinic's certificates now last 47 days, and its monitoring alerts when a certificate has fewer than 60 days left. What happens? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity