Security Basics — SSH, TLS and Certificates›12 · Certificate expiry and renewal

Lesson 12 of 16 · HTTPS and certificates

Certificate expiry and renewal

Why certificates expire on purpose, how public certificate lifetimes are shrinking (from 398 days towards 47 days by 2029), what happens when one expires, how to find every certificate you own, check expiry from the command line, alert well in advance, and a calm runbook for when one has already expired.

Practitioner
Key wordscertificate expirynotAftervalidity period398 days200 days100 days47 daysCA/Browser Forumshort-lived certificatesmonitoringopenssl -checkendblackbox exporterinventoryrenewal runbook

Expiry is a feature

Every certificate has a Not After date (lesson 8). After it, clients reject the certificate, and users see a full-page warning or apps fail outright. Expiry exists on purpose:

  • Limits damage from a stolen key. Revocation (lesson 9) is unreliable; expiry always works.
  • Keeps facts fresh. Domains change owners; the CA re-checks control at renewal.
  • Forces automation. Short lifetimes make manual renewal impractical, which is the point.

Lifetimes are shrinking

The CA/Browser Forum (CAs and browser makers) has agreed a schedule for public TLS certificates:

From Maximum lifetime
Until March 2026 398 days
15 March 2026 200 days
15 March 2027 100 days
15 March 2029 47 days

Let's Encrypt already issues 90-day certificates and offers even shorter ones. The message is clear: if a person has to remember to renew it, it will eventually expire in production. Private CAs set their own lifetimes, and many internal systems (service meshes, SPIFFE) already use hours or days.

A certificate is like a carton of milk with a use-by date. The date isn't there to annoy you; it stops anyone drinking something that's gone bad. And the shorter the date, the more you need a milk delivery (automation) rather than remembering to go to the shop.

Why expiry outages keep happening

Expired certificates have taken down major services, banking apps and even satellite and device fleets. The causes are rarely technical:

  • Nobody knew the certificate existed (a forgotten load balancer, an internal API, a device).
  • Renewal was manual and the person left.
  • Automation renewed the file but the service never reloaded it.
  • The certificate renewed, but an intermediate or a pinned CA in a client expired.
  • Monitoring checked the website, not the API, mail server, VPN or mTLS client certificate.

Know what you have: the inventory

You cannot renew what you don't know about. Build a list of every certificate: name, where it's used, issuer, expiry, owner, how it renews. Sources:

  • Certificate Transparency logs for every public certificate issued for your domains (lesson 9).
  • sudo certbot certificates, your load balancer and cloud certificate services.
  • A network scan of port 443 (and 8443, 636, 993…) across your ranges.
  • Kubernetes: kubectl get certificates -A with cert-manager.

Check expiry from the command line

$ openssl x509 -in web.crt -noout -enddate
notAfter=Feb  5 18:37:23 2027 GMT
$ openssl x509 -in web.crt -noout -checkend $((30*86400)); echo $?
Certificate will not expire
0
$ openssl x509 -in web.crt -noout -checkend $((100*86400)); echo $?
Certificate will expire
1
$ echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
    | openssl x509 -noout -enddate

Checking the live endpoint, not just the file, catches the "renewed but not reloaded" case.

Alert early, from outside

  • Probe every endpoint from outside, as a client would: for example Prometheus blackbox exporter with an alert when probe_ssl_earliest_cert_expiry - time() is under 21 days. ("Earliest" includes intermediates in the chain.)
  • Alert at a point where automation should already have renewed. With 90-day certificates renewed at 30 days left, an alert at 21 days means "automation is broken", with three weeks to fix it.
  • Send it to a team, not a person.

Runbook: it has already expired

  1. Confirm: openssl s_client … | openssl x509 -noout -dates. Expired, or wrong certificate, or a client clock problem (lesson 13)?
  2. Find where it is served: which load balancer, ingress or server, which file or secret.
  3. Renew or reissue: sudo certbot renew --force-renewal (or certbot certonly …), your CA's portal, or cert-manager (cmctl renew).
  4. Install and reload the service, then check the live endpoint shows the new dates.
  5. Check clients that pin certificates or CAs (mobile apps, partners, devices).
  6. Afterwards: add it to the inventory, automate renewal, add an external expiry alert, and write down why it was missed.

Recap

  • Expiry limits damage and forces automation; lifetimes are dropping to 47 days by 2029.
  • Outages come from unknown certificates, manual renewal, and renewed-but-not-reloaded services.
  • Keep an inventory, check live endpoints, alert early from outside.
  • When it expires: confirm, find, renew, reload, verify live, then fix the process.

This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.