Back to All Articles
MonitoringOct 16, 20268 min read

Automated SSL Alerts: How to Get Notified 30, 14, and 7 Days Before Expiration

Stop relying on calendar reminders for SSL renewals. Learn how to configure automated SSL expiration alerts via Slack, PagerDuty, and Webhooks 30, 14, and 7 days before an outage strikes.

P
Prabin Jha
Founder & Lead Architect
LinkedIn

Key Takeaways (BLUF)

Bottom Line Up Front (BLUF): Manual SSL certificate management guarantees eventual failure. To protect your brand and APIs from an expired certificate outage, you must implement an automated escalation strategy. By configuring WakeMetrics to probe your endpoints globally, you can receive proactive SSL expiration alerts via Slack and PagerDuty at 30, 14, and 7-day intervals, providing ample time to fix broken auto-renewals before customers are impacted.

The Fatal Flaw of "Set It and Forget It" SSL Automation

The push toward automated SSL provisioning via tools like Let's Encrypt and AWS Certificate Manager (ACM) has drastically improved internet security by reducing certificate lifespans to 90 days. However, this automation has created a false sense of security among engineering teams.

Many DevOps engineers assume that configuring a cronjob to run `certbot renew` completely solves the SSL lifecycle problem. This "set it and forget it" mentality is the primary cause of modern SSL outages.

Automated renewal agents fail silently for a multitude of reasons. A seemingly unrelated infrastructure change—such as updating a firewall rule, migrating to a new DNS provider, or rotating server IP addresses—can inadvertently block the HTTP-01 or DNS-01 validation challenges required by Let's Encrypt. When the cronjob fails, the certificate silently continues ticking toward expiration.

Without external monitoring, the team only discovers the failure when the certificate expires and production APIs crash. This is why external SSL expiration alerts are mandatory for production reliability.

  • Firewall Changes: A new WAF rule might block Let's Encrypt validation requests, breaking auto-renewal.
  • DNS Migration: Moving from Cloudflare to Route53 without updating DNS-01 challenge scripts will cause silent renewal failures.
  • Rate Limiting: Exceeding certificate issuance rate limits during deployments can prevent successful renewals.
  • Disk Space: A full server disk will prevent Certbot from writing the new certificate to the filesystem.

Building the 30-14-7 Escalation Matrix

An effective alerting strategy must balance proactive notification with alert fatigue prevention. If an alert fires 30 days before expiration but pages an engineer at 2:00 AM, it will be ignored and eventually muted. Conversely, if the first alert fires 2 days before expiration, there may not be enough time to navigate enterprise change control processes.

The optimal framework is the 30-14-7 escalation matrix. This strategy progressively increases the urgency of the alert as the expiration date approaches.

At 30 days, the system should trigger an informational webhook to a low-priority Slack channel (e.g., #ops-warnings). This provides the DevOps team early visibility. Often, auto-renewals are scheduled for 20 days prior to expiration, so this alert serves as a baseline check.

At 14 days, the auto-renewal should have succeeded. If it hasn't, an elevated alert is sent to a primary communication channel or creates a Jira ticket. At 7 days, the situation is critical. A PagerDuty incident should be triggered during business hours to ensure an engineer manually forces the renewal.

Configuring SSL Alerts in WakeMetrics

WakeMetrics automatically extracts and analyzes the SSL certificate on every HTTPS synthetic probe. You do not need to configure complex shell scripts or maintain internal cronjobs to track expiration dates.

When creating a new HTTP/API monitor, WakeMetrics natively tracks the `valid_to` timestamp of the certificate provided during the TLS handshake. You can configure custom thresholds directly in the dashboard to trigger alerts based on days remaining.

Days RemainingAlert SeverityRecommended ChannelAction Required
30 DaysWarningSlack (#ops-logs)Monitor for upcoming auto-renewal.
14 DaysElevatedJira / EmailInvestigate why auto-renewal failed.
7 DaysCriticalPagerDuty (Business Hours)Manually intervene and force renewal immediately.
< 1 DayOutage ImminentPagerDuty (24/7)Emergency response. Customer impact expected.

A Python Script for Internal SSL Auditing

While WakeMetrics handles continuous external monitoring, you may occasionally need to audit internal certificates across hundreds of subdomains. Below is a Python snippet using the `ssl` and `socket` modules to batch-check expiration dates. This is useful for one-off audits, but should not replace continuous external synthetic probing.

import ssl
import socket
from datetime import datetime

def get_ssl_expiry_date(hostname, port=443):
    context = ssl.create_default_context()
    context.check_hostname = False
    context.verify_mode = ssl.CERT_NONE  # Check even if invalid

    try:
        with socket.create_connection((hostname, port), timeout=5) as sock:
            with context.wrap_socket(sock, server_hostname=hostname) as ssock:
                cert = ssock.getpeercert(binary_form=True)
                x509 = ssl.DER_cert_to_PEM_cert(cert)
                
                # In a real script, parse the PEM or use a library like cryptography
                # For simplicity, we use the dict format from getpeercert() when verify_mode is CERT_REQUIRED
                # However, with CERT_NONE, getpeercert() returns empty.
                pass
    except Exception as e:
        print(f"Failed to connect to {hostname}: {e}")

# Note: For robust internal scripts, consider using the 'cryptography' library 
# to parse the x509 certificate accurately and extract not_valid_after.

Automating SSL Expiration Alerts for WordPress Sites

If you manage WordPress sites or client installations, relying on hosting control panel notifications is notoriously unreliable. Hosting emails often get flagged as spam or sent to obsolete administrative addresses.

By installing the free WakeMetric WordPress Plugin, you can monitor SSL validity from external cloud nodes and receive alerts via email, Slack, or Discord at 30, 14, and 7 days before expiration. For step-by-step instructions, read our guide on WordPress SSL Certificate Expiry Alert Setup.

Conclusion: Trust, but Verify

The core tenet of Site Reliability Engineering is "Trust, but verify." You should absolutely rely on automated agents like Certbot to provision and renew your certificates. However, you must simultaneously verify their success using an external, independent monitoring system.

By implementing a 30-14-7 automated alerting matrix, you eliminate the risk of silent renewal failures cascading into massive customer-facing outages.

Frequently Asked Questions

Why should I monitor SSL certificates externally?

External monitoring proves that the certificate is not only renewed on the server but is successfully being served to end-users across the internet. Internal scripts cannot verify firewall or load-balancer misconfigurations.

Can WakeMetrics alert me via Slack for SSL expirations?

Yes. WakeMetrics allows you to map specific threshold alerts (e.g., 14 days remaining) to specific notification channels, including Slack, Discord, and Webhooks.

Conclusion

Don't let a silent cronjob failure destroy your brand's reputation. Implement the 30-14-7 SSL alerting strategy and ensure your engineering team is always ahead of impending certificate expirations. Start monitoring your SSL endpoints with WakeMetrics today/signup/page.tsx).

Ready to Upgrade from UptimeRobot?

Migrate in under 60 seconds. Get 15-second checks across 450+ global locations with zero false alerts.