Skip to content
RU

Certificate Has Expired in curl, Node.js and OpenSSL: Find Which One and Fix It

What it means: A certificate in the chain is past its expiry date, by the client's clock.

  1. Check the client's date and time
  2. Find the expired certificate's depth
  3. Leaf expired: renew and reload
  4. Intermediate or root expired: fix chain or trust store

Test your URL now

Runs a full TLS check: handshake, protocol versions, certificate chain, trust and expiry.

Check your site's SSL →

What certificate has expired means

The text is OpenSSL verification error 10, X509_V_ERR_CERT_HAS_EXPIRED: «The certificate has expired: that is the notAfter date is before the current time» (X509_STORE_CTX_get_error). The check runs for every certificate in the chain OpenSSL builds, not only for the server's own, and «current time» is the clock of the machine doing the verifying.

You will see it as curl: (60) SSL certificate problem: certificate has expired, as Error: certificate has expired with code: 'CERT_HAS_EXPIRED' in Node.js (X509 error codes), and as certificate verify failed: certificate has expired in Python. Its mirror image is error 9, certificate is not yet valid, which you get when the client clock is behind the certificate's notBefore date.

Browsers show the same condition as NET::ERR_CERT_DATE_INVALID. This page is about scripts, APIs, CI jobs and devices, where the expired certificate is often not the one you think.

Which certificate expired

Expired itemSymptomFix
The leaf (depth 0)Fails for every client, browsers includedRenew, then reload the server so it serves the new file
An intermediate the server still sendsFails although the leaf is newReplace the chain file with the current intermediate
A root or cross-signed root in the client's pathOnly old clients or old trust stores failUpdate the client's CA bundle or runtime
Nothing: the client clock is wrongEvery HTTPS site fails from one deviceFix time sync (NTP)

The cross-signed root case is the one that surprises people. On 30 September 2021 Let's Encrypt's DST Root CA X3 cross-sign expired. Let's Encrypt warned that API clients must trust ISRG Root X1 and, if they use OpenSSL, must run version 1.1.0 or later, because «in OpenSSL 1.0.x, a quirk in certificate verification means that even clients that trust ISRG Root X1 will fail» with the compatible chain (Let's Encrypt). Old embedded devices and containers built on old base images showed exactly this error while the site was perfectly valid.

A renewed certificate that is not being served is the other classic: Certbot renewed the file on disk, but nginx keeps the old certificate in memory until it is reloaded.

Find the expired certificate

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>&1 | grep -E '^depth|verify error'
depth=1 C = US, O = Example CA, CN = Example Intermediate
verify error:num=10:certificate has expired

The depth line just before the error names the culprit: 0 is the server's certificate, 1 and above are the chain. To print every certificate the server sends with its dates:

openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null 2>/dev/null > chain.pem
openssl storeutl -noout -text -certs chain.pem | grep -E 'Subject:|Not After'

Then check the client side: date -u and timedatectl on Linux. A device whose clock reset to a factory date after a power cut fails with error 9 or 10 on every site.

How to fix it

  1. Fix the clock first if it is wrong: enable NTP (timedatectl set-ntp true) and re-test. Nothing else matters until the time is right.
  2. Leaf expired: renew it (certbot renew or your CA's process), then reload the server: nginx -t && systemctl reload nginx. With Certbot, a --deploy-hook "systemctl reload nginx" makes the reload automatic. Check that every node behind the load balancer serves the new certificate.
  3. Intermediate expired: download the current chain from your CA (or use the fullchain.pem your ACME client just wrote) and replace the old chain file. A stale chain file copied years ago is the usual source.
  4. Client trust store outdated: update the bundle (apt-get install --only-upgrade ca-certificates, a newer base image, a newer runtime). On clients still on OpenSSL 1.0.x, upgrade OpenSSL; that is the Let's Encrypt failure mode.
  5. Keep it from coming back: monitor expiry dates of the leaf and the chain, not just whether the site loads today.

How to confirm the fix

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate
notAfter=Jan 15 12:00:00 2027 GMT
curl -sS -o /dev/null -w '%{http_code} verify=%{ssl_verify_result}\n' https://example.com/
# 200 verify=0

Run the check against each server address if you have several. The SSL/TLS checker shows the expiry of the certificate your site serves and flags problems in the chain it sends.

Related errors

CertificateExpiry, issuer, domains (SAN)
ChainIntermediate and root CA validation
TLS ProtocolTLS version and cipher suite
VulnerabilitiesHeartbleed, POODLE, weak ciphers

Why teams trust us

TLS 1.3
supported
Full
CA chain check
3,158
checks in 30 days
30/14/7
days-to-expiry alerts

How it works

1

Enter domain

2

TLS chain verified

3

Expiry date & vulnerabilities

What Does the SSL Check Cover?

SSL/TLS is the encryption protocol that protects data between the browser and server. Our tool analyzes the certificate, chain of trust, TLS version, and knownvulnerabilities.

Certificate Details

Issuer, validity period, signature algorithm, covered domains (SAN), and validation type (DV/OV/EV).

Chain of Trust

Full chain verification: from leaf certificate through intermediates to root CA.

TLS Analysis

Protocol version (TLS 1.2/1.3), cipher suites, Perfect Forward Secrecy (PFS) support.

Expiry Alerts

Set up a monitor — get Telegram and email alerts 30/14/7 days before expiration.

DV vs OV vs EV Certificates

DV (Domain Validation)
  • Confirms domain ownership only
  • Issued in minutes automatically
  • Free via Let's Encrypt
  • Suitable for most websites
  • Most common certificate type
OV / EV
  • Organization (OV) or Extended Validation (EV)
  • Issued in 1-5 business days
  • Costs $50 to $500/year
  • For finance, e-commerce, government sites
  • Increases user trust

Who uses this

DevOps

SSL certificate monitoring

Security

TLS config audit

SEO

HTTPS as ranking factor

E-commerce

customer trust

Common Mistakes

Expired certificateBrowsers block sites with expired SSL. Set up auto-renewal or monitoring.
Incomplete certificate chainWithout intermediate CA, some browsers and bots cannot verify the certificate.
Mixed content on HTTPS siteHTTP resources on an HTTPS page — the browser lock icon disappears, reducing trust.
Using TLS 1.0/1.1Legacy TLS versions have known vulnerabilities. Use TLS 1.2+ or 1.3.
Domain mismatch in certificateThe certificate must cover all site domains, including www and subdomains.

Best Practices

Set up auto-renewalLet's Encrypt + certbot with cron — certificate renews automatically every 60-90 days.
Enable HSTSStrict-Transport-Security header forces browsers to always use HTTPS.
Use TLS 1.3TLS 1.3 is faster (1-RTT handshake) and safer — legacy ciphers removed.
Monitor expiration datesCreate a monitor on Enterno.io — get notified well before expiration.
Verify chain after renewalAfter certificate renewal, confirm that intermediate certificates are installed.

Get more with a free account

SSL certificate monitoring, check history and alerts 30 days before expiry.

Sign up free

Learn more

Sources

Frequently Asked Questions

I renewed the certificate. Why does it still say certificate has expired?

The server is still serving the old certificate from memory or from another node. Reload the web server on every node and check the notAfter date of what is actually served.

Why does only one old device or container fail?

It has an outdated trust store or an old OpenSSL that builds the chain through an expired root, as happened with Let's Encrypt's DST Root CA X3 in 2021. Update its CA bundle or base image.

Can a wrong clock cause certificate has expired?

Yes. Verification compares the certificate dates with the local clock, so a clock set far in the future makes valid certificates look expired. Fix the time and the error disappears.

What is the difference between error 9 and error 10?

Error 10 means the current time is after the certificate's notAfter date. Error 9 means it is before the notBefore date, usually a client clock running behind.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.