To check when an SSL certificate expires, open the site in a browser and view the certificate details, or paste the domain into an online checker, or run openssl or curl from a terminal. Each shows a "valid until" date, which is the last moment the certificate is accepted. Once that date passes, visitors get a full-page security warning instead of your site.
This guide gives four ways, from the quickest to the one you can script, and then explains how to stop checking by hand. We make YoTrackr, which can track SSL expiry next to your domain and hosting renewals, so we have a stake in that last part.
The short answer
| Method | Best for | Needs |
|---|---|---|
| Browser | One site, right now | Nothing |
| Online checker | Any public site, from outside your network | A web page |
| openssl | Servers and scripts, and a warning threshold | A terminal with openssl |
| curl | A quick look when you already have curl | A terminal, and a curl build that prints certificate details |
1. In your browser
Open the site, click the padlock or site-information icon in the address bar, and choose the option that shows the certificate. The wording differs between browsers and changes over time, but it leads to a details panel with a "Valid from" and "Valid to" (or "Expires on") date. This is the quickest check for a single site. It only shows the certificate your browser was given, and a browser can also be cached or behind a different network, so for anything important confirm with another method.
2. With an online checker
An online checker connects to your site from outside and reports the issuer, the dates and the days left. That matters because it shows what the public sees, not what your own machine sees. Our free SSL certificate checker does this: enter a hostname and read the expiry date. It is a single-site check, so for many sites you want a method that scales (see the end of this guide).
3. With openssl
On a Linux or macOS terminal, or Windows with openssl installed, this prints the dates, issuer and subject of the certificate your server presents:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates -issuer -subject
The notAfter line is the expiry. To print only that line:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate
To turn it into a yes-or-no check, add -checkend, which takes a number of seconds. This one asks whether the certificate will still be valid in 30 days (2,592,000 seconds), and reports it in the output and the exit code:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -checkend 2592000
That exit code is what makes openssl the right tool for a script or a cron job. The -servername option matters when one server hosts several sites: without it you may be shown another site's certificate.
4. With curl
If you already have curl, verbose mode prints the handshake, and on many builds that includes the certificate's dates:
curl -vI https://example.com 2>&1 | grep -i "expire date"
This depends on how your curl was built. Some builds, including some on Windows, do not print the expiry line, in which case use openssl or the browser instead.
What the result means
- More than 30 days left: fine, but check that automatic renewal is set up.
- Under 30 days and you use auto-renewal: look at the renewal log now. A healthy renewal normally happens well before the last week.
- Under 7 days: treat it as urgent and renew by hand.
- Already expired: follow SSL certificate expired: how to fix it fast.
Also check every hostname you serve, including www, subdomains and any API or admin addresses. Renewing the main site and forgetting a subdomain is a common cause of outages.
Stop checking by hand
Checking is fine for a one-off, but certificates expire quietly, and the job that renews them can fail without telling anyone. Two habits fix that. First, write down every certificate you are responsible for with its expiry date. Second, get a warning from something other than the renewal job itself.
That is what a tracker is for. In YoTrackr you add each domain or hosting item and it shows SSL status beside the renewal date, with reminders before the date arrives. It does not replace your certificate's own renewal, and it is not an uptime monitor. It is the independent warning the renewal job cannot give you. See how to monitor SSL certificates across client websites, and the AppSumo lifetime deal if you prefer a one-time payment.
Frequently asked questions
How do I check an SSL certificate's expiry date? View the certificate in your browser, use an online checker, or run openssl x509 -noout -enddate on the certificate your server presents.
How long is an SSL certificate valid? It depends on the issuer and the type. Let's Encrypt certificates are short-lived and meant to be renewed automatically, so check your own certificate's dates instead of assuming a length.
What happens when an SSL certificate expires? Browsers show a full-page warning, most visitors leave, and API clients and webhooks that verify certificates start failing.
Why does the browser show a different date from my server? A CDN or proxy can present its own certificate at the edge while your origin server has another. Check both.
Can I check a certificate for a site I do not own? Yes. The certificate is public, so any of the four methods works on any site you can reach.
Keep reading. Renewing SSL certificates without downtime covers the renewal itself, and the domain expiry checklist does the same for domains.
