Paj Digital Labs
All articles
Hosting & Server Infrastructure

TLS Certificate Renewal: Verify the Served Certificate, Not Just the Cron Job

A successful renewal command does not prove visitors see the new certificate. Trace issuance, reloads, proxy termination and external monitoring before an expiry becomes an outage.

Paj Digital Labs 3 min read
Server racks and network cabling in a data center
Editorial illustration · Hosting & Server Infrastructure

A certificate renewal job exits successfully. Two weeks later the website presents an expired certificate. There is no contradiction: the job may have renewed a file that the public-facing process never reloaded, or a certificate on a machine that no longer terminates TLS.

Certificate management is a delivery chain. The useful check follows that chain all the way to the hostname and port a visitor actually uses.

Identify where TLS ends

Draw the request path: browser, CDN, load balancer, reverse proxy and application. Each encrypted hop can use a different certificate. Renewing the origin certificate does not renew the CDN certificate, and a healthy public certificate can hide an origin problem until the CDN reconnects.

List every served hostname, including redirects, alternate domains and service endpoints. Record the issuer, renewal mechanism, certificate location and responsible service. Wildcards do not cover every possible depth of subdomain, and the apex may need its own name in the certificate.

Avoid assuming the configuration file you found is active. Check the running server's loaded configuration and the actual listener. A retired server can continue renewing certificates perfectly while production is somewhere else.

Understand the challenge path

ACME clients commonly prove control through HTTP or DNS challenges. HTTP validation needs the expected challenge URL to reach the correct service. Redirects, authentication gates and a proxy routing rule can interfere.

DNS validation requires the challenge record to be visible to authoritative and external resolvers. Automated DNS credentials should have the narrowest supported scope. A wildcard certificate usually involves DNS validation, which makes protecting those credentials particularly important.

Do not disable the site's security controls wholesale to pass a challenge. Route the narrow challenge path intentionally, or choose an appropriate supported validation method. Test after changing DNS, firewalls or CDN settings.

Exercise renewal safely

With Certbot, a dry run tests renewal against the staging service rather than repeatedly requesting production certificates. Check the current Certbot documentation for your plugin and installation method.

bash
sudo certbot certificates
sudo certbot renew --dry-run
sudo systemctl list-timers --all | grep -i certbot

These commands inspect certificates, test renewal and inspect timer scheduling. Other clients and distributions use different mechanisms. A successful dry run demonstrates the tested validation path; it does not guarantee that a later deployment hook or public edge configuration works.

Avoid aggressive production retries. Certificate authorities enforce rate limits, and an automation loop can turn a recoverable mistake into a longer outage.

Reload only after validation

A server may retain a certificate in memory until reload. Configure a deploy hook that checks server configuration and reloads the actual TLS terminator after a successful renewal.

For nginx, test configuration before reload:

bash
sudo nginx -t && sudo systemctl reload nginx

Use the proper command for your installation. A reload is not a restart, and neither is safe merely because a certificate file exists. Check hook exit status and logs rather than suppressing failures to keep the timer green.

If several services consume one certificate, identify all of them. Mail, control panels and web servers can have different reload procedures. Copying private keys broadly is not a substitute for an intentional deployment mechanism.

Inspect the certificate externally

SNI matters when several hostnames share an address. This example inspects the leaf certificate served for an illustrative hostname:

bash
openssl s_client -connect example.com:443 -servername example.com \
  </dev/null 2>/dev/null | openssl x509 -noout -dates -issuer -subject

It shows what the endpoint presents, not a complete trust and hostname validation result. Use a client or monitoring tool that also checks trust chain, hostname and handshake success. Test IPv4 and IPv6 paths when both are published; they can reach different machines.

For a load-balanced service, check all applicable endpoints through an approved method. One healthy node does not prove a rotation completed everywhere.

Alert on the outcome

Monitor days to expiry for the public endpoint and relevant origin endpoints. Choose warning intervals that give your team time to act, and test that the alerts reach a real owner. Also alert on failed renewal and deployment hooks so you learn about a broken chain before the certificate gets close to expiry.

Document how to roll back a failed server configuration without reverting to an expired certificate. Keep private key backups encrypted and access-controlled; do not paste them into support chats or incident notes.

The certificate that matters is the one the client receives. A cron job, renewed file and successful reload are useful intermediate evidence. External verification is what closes the operational loop.

Paj Digital Labs

The engineering journal of Paj Digital Solutions — hosting, server infrastructure and web engineering, written by the people who run the servers.

Related reading