Monitor SSL Certificate Expiry Automatically
An expired certificate shows visitors a full-page browser warning and breaks API calls at the same moment. Free certificates (90 days now, 64 days from 10 February 2027, per the Let's Encrypt announcement) make this more likely than a yearly paid one, so monitoring matters even when renewal is automated. Automation can fail silently, and you want to learn about it with weeks to spare.
What to monitor
- Days until expiry for every public hostname, including subdomains and mail servers.
- That renewal itself still works, not just that today's certificate is valid.
- That the served certificate is the new one after renewal. A renewed file that the server never reloaded still serves the old certificate.
Quick manual check
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -enddate
The SSL Checker shows the same date with the chain. To review many hosts at once, use the Bulk SSL Checker.
A simple script for cron
openssl x509 -checkend exits with a failure code if the certificate expires within the given seconds. Here 14 days is 1,209,600 seconds, which sits after the normal renewal point:
#!/bin/sh
for host in example.com www.example.com api.example.com; do
if ! echo | openssl s_client -connect "$host:443" -servername "$host" 2>/dev/null \
| openssl x509 -noout -checkend 1209600 >/dev/null; then
echo "Certificate for $host expires within 14 days" | mail -s "SSL expiry warning: $host" you@example.com
fi
done
Run it daily from cron. You need a working local mail command, or replace the mail line with a call to your chat or alerting webhook.
Test the renewal job
sudo certbot renew --dry-run
systemctl list-timers | grep certbot
If the dry run fails, fix it now. Common causes are covered in how to fix Certbot renewal errors. Add a deploy hook that reloads the web server after renewal.
Alert thresholds
| Days left | Action |
|---|---|
| 30 | Informational notice for 90-day certificates only. On 64-day certificates skip it, since renewal starts around 21 days left |
| 14 | Warning, investigate why renewal has not happened |
| 7 | Urgent, renew manually |
| 3 | Page the on-call person |
Let's Encrypt clients normally renew when a third of the lifetime remains. That is about 30 days before expiry on a 90-day certificate and about 21 days on a 64-day one. A 30-day alert on a 64-day certificate would therefore fire during normal operation, so start at 14 days there.
Other options
Uptime monitoring services and many hosting dashboards include certificate expiry alerts. Keep a spreadsheet or inventory of domains, because forgotten subdomains cause most surprise expirations. Do not depend on CA emails: Let's Encrypt ended its expiration emails on 4 June 2025.
Watch for silent failures
Common silent failures include a renewal that succeeds on disk while the server keeps serving the old certificate, a DNS or firewall change that breaks validation weeks before expiry, and a certificate on a secondary service such as a mail or API host that nobody tracked. Monitor the certificate that clients actually receive, not only the files.
Frequently asked questions
How early should I renew?
With automation, renewal happens when a third of the lifetime is left: around 30 days before expiry on a 90-day certificate and about 21 on a 64-day one. Alert at 14 days if the certificate has not changed.
Why did my certificate expire even though renewal is automatic?
Usually the timer is not running, validation fails, or the server was not reloaded after renewal.
Do wildcard certificates need monitoring too?
Yes, and because they cover many hosts, an expiry affects all of them.
Can I monitor a certificate I do not own?
Reading a public certificate is fine for monitoring.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.