TLS certificates and automated renewal

Intermediate · 5 min

Why certificate expiry is a classic outage, how ACME gets and renews certificates with no human in the loop, and why lifetimes are dropping to 47 days.

Before thisDNS records and TTLs in practiceReverse proxies and load balancers with nginx

FixMyCert · 5 min

TLS certificates and automated renewal

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by FixMyCertReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • A certificate binds domain names to a public key and is valid only between two dates. When the end date passes, every client refuses the connection, so expiry is an outage, not a warning.
  • ACME is the protocol that lets a client prove control of a domain and get a certificate with no human involved, by serving a token over HTTP or publishing it in DNS.
  • Public certificate lifetimes are shrinking: at most 200 days from March 2026, 100 from March 2027 and 47 from March 2029. Manual renewal stops being an option.
  • Renewal is a scheduled job plus a reload. The client renews well before expiry, and the web server reloads to pick up the new files.
  • Monitor expiry from outside, because a renewal job that fails quietly looks fine until the day the certificate runs out.

The outage nobody planned

Somebody bought a certificate two years ago, installed it on the load balancer, and set a calendar reminder. Then they changed teams. One morning every browser shows a full-page security warning, the mobile app stops working, and other services calling your API fail their TLS checks. Nothing changed in your code. A date passed.

How TLS keeps a connection private and why browsers trust a certificate is covered in TLS and HTTPS. The operator’s problem is narrower and more mundane: certificates expire, and a manual process eventually misses one. The fix is to make renewal a machine’s job.

What you are renewing

A certificate is a signed statement from a certificate authority: “this public key belongs to these domain names, from this date to that date”. I fetched the certificate chain that letsencrypt.org serves, with OpenSSL 4.1.0:

$ echo | openssl s_client -connect letsencrypt.org:443 -servername letsencrypt.org -showcerts
 0 s:CN=letsencrypt.org
   i:C=US, O=Let's Encrypt, CN=YE2
 1 s:C=US, O=Let's Encrypt, CN=YE2
   i:C=US, O=ISRG, CN=Root YE
 2 s:C=US, O=ISRG, CN=Root YE
   i:C=US, O=Internet Security Research Group, CN=ISRG Root X2
 3 s:C=US, O=Internet Security Research Group, CN=ISRG Root X2
   i:C=US, O=Internet Security Research Group, CN=ISRG Root X1
$ openssl x509 -in leaf.pem -noout -dates
notBefore=Nov  3 13:44:34 2026 GMT
notAfter=Feb  1 13:44:33 2027 GMT

Each certificate is signed by the one below it, ending at roots that browsers already trust. The leaf is valid for exactly 90 days. That window is the thing to manage. openssl x509 -checkend 2592000 exits non-zero if the certificate expires within 30 days, which makes a one-line monitoring check.

Lifetimes are shrinking

Shorter certificates limit the damage of a stolen key and make revocation matter less. In 2025 the CA/Browser Forum, which sets the rules public CAs follow, voted to cap lifetimes at 200 days from March 2026, 100 days from March 2027 and 47 days from March 2029. Let’s Encrypt already offers a 45-day tlsserver profile and a roughly six-day shortlived one, and its blog says the default will drop to 64 days in February 2027 and 45 days in February 2028. At 45 days you renew about every month. Nobody does that by hand for long.

ACME: renewal without humans

ACME (Automatic Certificate Management Environment, RFC 8555) is the protocol Let’s Encrypt built so a program can get a certificate. Many other CAs support it now. Every ACME server publishes a directory, and this is the real one:

$ curl -s https://acme-v02.api.letsencrypt.org/directory | jq 'del(.meta.website)'
{
  "keyChange": "https://acme-v02.api.letsencrypt.org/acme/key-change",
  "meta": {
    "caaIdentities": ["letsencrypt.org"],
    "profiles": { "classic": "...", "shortlived": "...", "tlsserver": "..." },
    "termsOfService": "https://letsencrypt.org/documents/LE-SA-v1.8-July-06-2026.pdf"
  },
  "newAccount": "https://acme-v02.api.letsencrypt.org/acme/new-acct",
  "newNonce": "https://acme-v02.api.letsencrypt.org/acme/new-nonce",
  "newOrder": "https://acme-v02.api.letsencrypt.org/acme/new-order",
  "renewalInfo": "https://acme-v02.api.letsencrypt.org/acme/renewal-info",
  "revokeCert": "https://acme-v02.api.letsencrypt.org/acme/revoke-cert"
}

(I shortened the profile URLs and dropped a random test key the server adds to keep clients from hard-coding the list.) A client such as certbot walks this flow:

  1. Create an account, which is just a key pair.
  2. Place a new order for notes.example.com.
  3. The CA returns a challenge. For HTTP-01 the client serves a token at http://notes.example.com/.well-known/acme-challenge/<token>. For DNS-01 it publishes a TXT record at _acme-challenge.notes.example.com. Wildcards need DNS-01.
  4. The CA fetches the token from several network locations. If it matches, you have proven control.
  5. The client sends a certificate signing request and downloads the certificate.

The caaIdentities field connects to the CAA records from the DNS lesson. A domain whose CAA record does not name letsencrypt.org cannot get a certificate from it.

When to renew

The renewalInfo endpoint is ACME Renewal Information (ARI): the CA tells you when to renew. I built the certificate ID for the letsencrypt.org leaf above from its authority key ID and serial number and asked:

$ curl -s https://acme-v02.api.letsencrypt.org/acme/renewal-info/uVnyjs8i8IbTN0j_dhQYuoLYVYc.BWiMkq1RKjZ422NVgxoL-70y | jq .
{
  "suggestedWindow": {
    "start": "2027-01-01T16:28:38Z",
    "end": "2027-01-03T11:39:28Z"
  }
}

That window falls about 59 days into a 90-day certificate, roughly two thirds of the way through, leaving a month to retry if something breaks. If the CA ever has to revoke certificates in bulk, it can move the window earlier, and clients that check ARI renew on their own.

Wiring it up on a server

With certbot and nginx the setup is short. I did not run it, because it needs a public server and domain, so this is from certbot’s documentation:

sudo certbot --nginx -d notes.example.com          # get it, edit the nginx config
sudo certbot renew --dry-run                        # test renewal against staging
# the package's systemd timer or cron job runs `certbot renew` twice a day
# /etc/letsencrypt/renewal-hooks/deploy/reload.sh:  systemctl reload nginx

The deploy hook matters. Renewal writes new files, but nginx keeps serving the certificate it loaded until it reloads. Newer nginx can do ACME itself: the official image I unpacked ships ngx_http_acme_module.so, though it is not loaded by default. In Kubernetes, cert-manager plays the same role. Whatever you use, add an outside check that alerts at 14 days left. A renewal job that fails quietly is the same outage, just later.

About the video

“ACME Protocol Explained - How TLS Automation Actually Works” is from FixMyCert, published March 2026, 5 minutes 17 seconds, with no chapters. Its description lists the issuance flow, HTTP-01 versus DNS-01 versus TLS-ALPN-01, why wildcards need DNS-01, rate limits and the staging environment, and other CAs that speak ACME. It does not cover wiring renewal into a web server, which the SysAdmin Hub video in deeper does with certbot. FixMyCert is a small, new channel. English was judged from the title, description, channel and its English auto-caption track.

Where this fits

Your traffic now arrives encrypted at the proxy. Last in this group, what to do when it does not arrive at all: firewalls, ports and network troubleshooting. Environments, domains and TLS shows the same setup from a full-stack project’s side.

Check yourself

  1. 01Why do certificate expiries cause outages even at well-run companies?

    Renewal happens rarely, so it lives in someone's memory or calendar, and nothing fails until the exact moment the old certificate expires. Then every client fails at once.

  2. 02When would you use the DNS-01 challenge instead of HTTP-01?

    For a wildcard certificate, which requires DNS-01, or when the server is not reachable from the internet on port 80. DNS-01 needs API access to your DNS provider.

  3. 03certbot renewed the certificate files but browsers still see the old expiry date. What is missing?

    The web server still has the old certificate loaded. It needs a reload, usually set as a deploy hook such as systemctl reload nginx.

  4. 04What does ACME Renewal Information (ARI) add to a renewal job?

    The CA tells the client when to renew through a suggested time window. It can spread renewals out, or ask everyone to renew early if certificates have to be revoked.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark