The TLS certificate expires soon
- Check
tls.expiry- Severity
- high
- Runs
- on our side, against a domain you verified
- Looks at
- Days until the certificate expires (warn under 21, fail under 7; less for short-lived certificates)
What the check looks at
Once a day we connect to the domain on port 443, read the certificate the server sends and count the days until
its notAfter date. For a 90-day certificate, under 21 days is a warning and under 7 days a failure. Shorter
certificates get shorter limits: a warning under a quarter of the lifetime, a failure under an eighth.
Risk
An expired certificate gets a full-page browser error, and API clients, payment callbacks and mobile apps stop connecting. certbot renews Let's Encrypt certificates (90 days) 30 days before they expire, so less than 21 days left usually means that renewal has failed at least once. Let's Encrypt stopped sending expiry e-mails on 2025-06-04. It moves to 45-day certificates by 2028, and the CA/Browser Forum limit falls to 47 days in March 2029.
How to fix it
certbot (Debian, Ubuntu, RHEL family)
sudo certbot certificates # expiry date per certificate
sudo certbot renew --dry-run # shows the error without changing anything
sudo journalctl -u certbot.service -n 50 # Debian, Ubuntu: log of the timer runs
sudo certbot renew # renew what is due
Typical errors: port 80 blocked for the HTTP-01 challenge, an expired DNS API token for DNS-01, a changed web root, or a domain that points to another server.
Caddy
Caddy renews on its own. Read its log: sudo journalctl -u caddy -n 100 | grep -i -E 'renew|obtain|error'.
Renewed, but the server sends the old certificate
Reload the web server (sudo systemctl reload nginx, apache2, httpd) and add a deploy hook, for example a
script in /etc/letsencrypt/renewal-hooks/deploy/ that runs systemctl reload nginx.
A certificate bought from a CA
Order a new one. If your CA supports ACME, renewal can run automatically.
How to check the fix
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -enddate
The date must be about one certificate lifetime ahead. The next daily check clears the warning.
When a warning is fine
For a domain that is being shut down and will not be renewed.