ssl-guides 2026-12-02 ⏱ 3 min read

SSL Certificate Expiration Alerts: Setup Guide

SSL Certificate Expiration Alerts: Setup Guide

To set up SSL certificate expiration alerts, check the certificate your server actually presents on a schedule and notify someone when fewer than 14 days remain. Renewal jobs can break silently, so the alert has to be separate from the renewal. The options below run from a calendar reminder to a cron script, a hosted monitor and Prometheus.

Choose how to send SSL certificate expiration alerts

MethodEffortReliabilityGood for
Calendar reminderMinutesDepends on youOne or two certificates
Cron script with emailLowHigh if the server stays upSmall fleets
Uptime monitor with SSL checkLowHigh, runs externallyProduction sites
Prometheus blackbox exporterMediumHighTeams already using Prometheus
CA expiry emailsNoneUnreliable, and Let's Encrypt no longer sends themA backup only

Method 1: A calendar reminder

Look up the end date with the Live SSL Checker, then create an event 14 days before expiry. Normal renewal starts at a third of the lifetime (30 days left on a 90-day certificate, about 21 on a 64-day one), so an alert at 14 days means renewal has already failed. Invite a second person for anything that matters.

SSL certificate expiration alerts with a cron script

#!/bin/bash
# check-cert.sh: warn when a certificate expires within N days
DOMAIN=example.com
DAYS=14
end=$(echo | openssl s_client -connect $DOMAIN:443 -servername $DOMAIN 2>/dev/null \
      | openssl x509 -noout -enddate | cut -d= -f2)
end_s=$(date -d "$end" +%s)
now_s=$(date +%s)
left=$(( (end_s - now_s) / 86400 ))
if [ "$left" -lt "$DAYS" ]; then
  echo "$DOMAIN certificate expires in $left days ($end)" \
    | mail -s "SSL expiry warning: $DOMAIN" you@example.com
fi
# Run every day at 07:00
0 7 * * * /usr/local/bin/check-cert.sh

The script needs a working mail command. If your server cannot send mail, post to a webhook with curl instead. The date -d syntax is for GNU date; macOS uses a different form.

SSL certificate expiration alerts from a hosted monitor

Many uptime services check certificate expiry and alert by email, SMS or chat. Choose one that checks from outside your network, set the threshold to 14 days, and add every hostname, including subdomains and API endpoints. Test it by pointing it at a known soon-to-expire or staging certificate if you can.

Method 4: Prometheus

- alert: SSLCertExpiringSoon
  expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 14
  for: 1h
  labels:
    severity: warning

This uses the blackbox exporter's probe_ssl_earliest_cert_expiry metric.

What to monitor

  • Every public hostname, not just the home page.
  • The certificate served by the load balancer or CDN, not only the origin.
  • Internal services, mail servers and APIs that use certificates.
  • Certificates stored in files that no web server uses.

When an alert fires

Renew first, then investigate why automation failed. If you need a replacement quickly, issue a free certificate with TryFreeSSL, install it, and recheck with the checker. See our guide on fixing an expired certificate for the full steps.

Related reading: a free SSL certificate monitor, Check an SSL Certificate's Expiration Date and monitoring 64-day certificates.

FAQ

How early should the alert be?

Fourteen days works for 90-day and 64-day certificates. Renewal starts at a third of the lifetime, which is 30 days left on a 90-day certificate and about 21 on a 64-day one, so an alert at 14 days only fires after renewal has failed for a while. For 45-day certificates, where renewal starts at 15 days left, use 10 days (Let's Encrypt announcement).

Will the CA warn me?

Not Let's Encrypt. It stopped sending expiration emails on 4 June 2025 (Let's Encrypt announcement). Other CAs may still send them, but addresses change and messages get filtered, so do not depend on it.

Do I need alerts if renewal is automatic?

Yes. Auto-renewal can fail because of DNS changes, firewall changes or expired API tokens.

Can I monitor sites I do not own?

Technically yes, for public certificates, but only monitor systems you are responsible for.

🔒 Test Your Website SSL Certificate Now
Run Free SSL Check →

✅ 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 www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant