How to Monitor SSL Certificate Expiry Automatically
Expired certificates still catch careful teams out. Learn how to read the expiry date, automate the check, route alerts and build a renewal routine that works.
10 min readUpdated Nov 21, 2026By XPASS Editorial Team

Few failures are as avoidable and as embarrassing as an expired SSL certificate. One morning your site greets every visitor with a full-page warning, your payment page refuses to load, and an integration that has worked for years starts returning errors. Nothing changed in your code. A date simply passed.
Certificates are issued for a limited period on purpose. Short lifetimes reduce the damage if a private key leaks and push everyone toward automation. The flip side is that someone, or something, has to make sure each certificate is replaced before its date. In this guide you will learn where the expiry date lives, how to check it with simple tools, how to automate the check and the alerts, and how to build a routine that catches problems even when automatic renewal quietly fails. If your site also redirects visitors to HTTPS, an expired certificate breaks that path too, so read this alongside how to force an HTTP to HTTPS redirect correctly.
Why certificates expire
A certificate is a signed statement that a public key belongs to a particular name. The standard format, X.509, is described in RFC 5280. Each certificate carries a validity period with two fields, notBefore and notAfter. A browser checks the current time against these fields. Outside the period the certificate is treated as invalid, however perfect everything else may be.
There are good reasons for limited lifetimes:
- If a private key is stolen, the damage ends when the certificate does.
- Information in a certificate, such as the organisation name or the list of hostnames, is rechecked at each issue.
- Short lifetimes encourage automation, which reduces human error.
The industry has been moving toward shorter lifetimes, and the rules are set by the browser and certificate authority community, including the CA/Browser Forum. Do not rely on remembering that "ours lasts a year". Read the date from the certificate itself, and expect the number to change over time.

What happens on the day it expires
When the date passes, the server keeps working but the browser stops trusting the certificate. Typical consequences:
| Who is affected | What happens |
|---|---|
| Website visitors | A full-page warning; most leave and do not return |
| Customers at checkout | Payment pages fail to load or show alerts |
| API clients and mobile apps | Connections are refused, often with errors that look like network failures |
| Email and other services | Mail servers using the certificate may be rejected by strict peers |
| Search visibility | Crawlers may fail to fetch pages, and long outages can hurt rankings |
Notice that the problem also affects things that never show a browser warning: webhooks, scheduled jobs, and partner systems. This is why monitoring should include more than the home page.
Reading the expiry date by hand
Before automating, know how to check one certificate manually.
- In a browser. Click the padlock or the site information icon, open the certificate details and find the validity section. It lists the start and end dates.
- With a command-line TLS client. Connect to the hostname on port 443 and print the certificate dates. The output includes
notBeforeandnotAfter. Many operating systems already include such a tool. - On the server. Read the certificate file and print its dates with the same tool. This tells you what is on disk, but not necessarily what the web server is serving, because a server may need a reload to pick up a new file.
That last point matters. Always check what the live endpoint presents, because a renewed file that was never loaded is the same as no renewal.
Building an automatic check
A monitor needs three parts: a way to fetch the certificate, a way to compute days remaining, and a way to tell someone.
Option 1: a small script on a schedule
A script run by a scheduler, such as cron, can do the job. The logic is:
- For each hostname in a list, connect over TLS and read the
notAfterdate. - Convert it to a date and subtract today's date to get the days remaining.
- If the number is below a threshold, send a message by email, chat webhook or ticket.
- Log every result, including success, so that a silent failure is visible.
Run it daily. Run it from a different machine than the one that serves the site, so that an outage of the server does not take the monitor with it.
Option 2: a monitoring service or uptime tool
Many uptime and observability tools include certificate checks. They connect from outside, track days remaining and send alerts to email or messaging apps. This is convenient and gives an external view. Check what the tool actually tests: some only check the leading hostname and not the whole chain.
Option 3: built-in checks in your platform
Container platforms, load balancers and hosting panels often show certificate status or can send expiry notices. Use these as an extra layer rather than the only one.
Option 4: checks in your deployment pipeline
A job that fails the build when a certificate has fewer than a set number of days left makes the issue visible to developers, who are often the people who can fix it.
Choosing thresholds and routing alerts
One alert is not enough. A practical layout is:
| Days remaining | Level | Action |
|---|---|---|
| About 30 | Notice | Confirm the renewal job is scheduled |
| About 14 | Warning | Check the renewal job output and fix any failure |
| About 7 | Urgent | Renew by hand if automation has not worked |
| About 3 | Critical | Escalate to a second person and a phone call |
Adapt the thresholds to your process. If certificates come from a person who must buy and install them, a longer lead time is sensible. If you use automatic issuance, the first alert is a safety net and should rarely fire.
Route alerts to a shared place, not one person's inbox. People change jobs, take leave and mute folders. A team channel plus a ticket gives you both visibility and a record. Finally, add a "no news" alert: if the monitor itself has not reported for a day, someone should hear about it.
What to monitor besides the date
An expiry date is the most common failure, but a good check also looks at:
- The chain. The server should send the leaf certificate and the required intermediate certificates. A missing intermediate causes errors on some devices even though the leaf is fine.
- The hostname match. The certificate must list the exact name being visited. If it does not, see the guide to SSL certificate name mismatch.
- The issuer. A sudden change in issuer can signal a misconfiguration or a replaced certificate.
- Every endpoint. Check
example.com,www.example.com, API hosts, mail hosts and any admin panel. Each may use a different certificate. - Both IP versions. If you publish IPv4 and IPv6 records, test both, since they may reach different servers.
A worked example
Imagine a small company with a website, a booking API and a mail server. Their certificates come from an automated issuer that renews through the ACME protocol, described in RFC 8555, about a month before expiry.
One evening, someone tightens a firewall rule and blocks the port the issuer uses for validation. Renewal begins failing. The site continues to work, and nobody notices, because the certificate in use is still valid.
The company has a daily script that checks the live certificate for six hostnames. On the day the remaining time drops under 14 days, the script posts a warning to the team channel and opens a ticket. An engineer reads the renewal log, sees the validation error, fixes the firewall rule and runs the renewal. The script confirms the next day that the new date is far in the future. No visitor saw a warning. Without the monitor, the failure would have remained invisible until the old certificate expired.
Making renewal itself more reliable
Monitoring catches failure; good renewal practice prevents it.
- Use automatic issuance where possible. The ACME protocol and tools built on it, as explained in Let's Encrypt's overview, exist to remove manual steps.
- Make sure the web server reloads after renewal. A renewal hook that reloads the service is a standard part of a reliable setup.
- Keep validation paths open. If your issuer checks a file over HTTP or a DNS record, firewalls, redirects and DNS changes must not break that path.
- Write down who owns each certificate, which hostnames it covers, where it is installed and how to renew it by hand.
- Test the manual procedure once a year, before you need it under pressure.
- Keep the account details for your certificate provider somewhere that more than one person can reach.
Limits and what to watch for
- Monitoring does not renew. It only tells you. Pair it with an automatic renewal or a clear manual process.
- False comfort from the file system. A certificate on disk is not the certificate being served. Always test the live endpoint.
- Alert fatigue. Too many low-value alerts train people to ignore them. Keep thresholds meaningful.
- Third-party hosts. If another company serves your domain, such as a landing page tool, you still need to check what it presents.
- Clock differences. Servers with a wrong clock can see a valid certificate as expired or not yet valid. Keep time synchronised.
- Changes ahead. Certificate lifetimes and validation rules evolve. Review your process when your provider announces changes.
- Security settings that raise the stakes. Features such as HSTS make an expired certificate harder for visitors to bypass, which is covered in HSTS setup precautions.
A plain outline of a daily check
To make the script option concrete, here is the outline in words. Keep a text file with one hostname per line. Each day the scheduler starts the script, which loops through the file. For each name it opens a TLS connection on port 443, asking for that hostname so that servers hosting several sites return the right certificate. It reads the notAfter value, turns it into a date and counts the days between that date and today. If the count is below the notice level, it writes a line to a log and sends a message that names the host, the date and the number of days left.
Two details make the difference between a toy and a dependable tool. First, treat a failed connection as an alert, not as silence: if the script cannot connect, the certificate may already be broken. Second, send a short daily summary even when everything is fine, such as "6 hosts checked, nearest expiry in 41 days". When that message stops arriving, you know the monitor is broken, which is exactly the failure that otherwise hides until it is too late.
Summary
An SSL certificate has a built-in end date, and when it passes, browsers and clients stop trusting your site. Know where to read the date, and monitor the certificate that the live endpoint presents, not only the file on disk. Automate the check with a scheduled script, a monitoring service or a pipeline job, run it from outside your server, alert on several thresholds and send the alerts to a shared place. Cover every hostname and watch the chain and name as well as the date. Combine monitoring with automatic renewal, a reload step and a documented manual fallback, and test that fallback before you need it.
When you are ready to choose a certificate for your own domain, the SSL certificates page explains what is available.
Frequently asked questions
What happens when an SSL certificate expires?
Browsers show a full-page warning saying the connection is not private or the certificate has expired. Most visitors leave, API clients may refuse to connect, and automated integrations can fail until a valid certificate is installed.
If my certificate renews automatically, do I still need monitoring?
Yes. Automatic renewal can fail quietly because of a changed DNS record, a blocked validation path, a full disk, a stopped scheduler or a certificate that was never reloaded by the web server. Monitoring checks what visitors actually receive.
How early should I be warned?
A common pattern is several alerts: a first notice about a month before expiry, a more urgent one two weeks before, and a critical one a few days before. Choose thresholds that match how long your renewal process really takes.
Where can I read the expiry date of a certificate?
Click the padlock in a browser and view the certificate details, or use a command-line TLS client to connect to the host and print the notAfter field. The date is stored in the certificate itself, as defined by the X.509 profile.
Should I monitor only the main domain?
No. Monitor every hostname that serves a certificate, including www, subdomains, mail and API hosts, and any endpoint behind a CDN or load balancer, because each can present a different certificate.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need an SSL certificate?
Pick the certificate type that fits your site and see the price before you check out.
SSL from $14.99
See SSL certificatesKeep reading

SSL Guides
How to Force an HTTP to HTTPS Redirect Correctly
Installing a certificate is only half the job. Learn how to send every visitor to the HTTPS version with a clean, loop-free permanent redirect.
10 min read

SSL Guides
How to Set Up HSTS: What to Watch Out For
HSTS hardens HTTPS, but browsers remember it for a long time. Learn what the header does, how to roll it out in stages and which mistakes can lock people out.
10 min read

SSL Guides
What Is Mixed Content and How Do You Fix It?
A padlock that disappears or a script that never loads is often mixed content. Learn what it is, how to find the offending URLs and how to fix them properly.
10 min read