PromptHub
DevOps Intermediate 14 views

SSL Certificate Expired

The SSL/TLS certificate for the website has expired and is no longer valid.

Explanation

SSL Certificate Expired means the digital certificate that enables HTTPS for your domain has passed its expiration date. Browsers will show security warnings and may refuse to connect entirely. SSL certificates have a limited validity period (typically 90 days for Let's Encrypt, 1 year for commercial CAs). This commonly happens when automatic renewal fails, when the certificate was manually installed without setting up renewal, or when DNS changes broke the validation process during renewal.

Common Causes

  • Certificate expired without renewal
  • Automatic renewal failed
  • DNS changes broke validation
  • Certbot not installed or configured
  • Firewall blocking renewal validation

Solution

Check the certificate expiration date: echo | openssl s_client -connect domain.com:443 2>/dev/null | openssl x509 -noout -dates. For Let's Encrypt, run certbot renew: sudo certbot renew. If renewal fails, check DNS configuration and ensure port 80 is accessible for HTTP-01 validation. Set up automatic renewal with a cron job or systemd timer. For commercial certificates, purchase a new one and install it. Verify the certificate chain is complete. Use certbot --dry-run to test renewal before the actual expiry. Monitor certificate expiration with tools like certbot's built-in reminders or external monitoring services.

Code Example

# Check certificate expiration
echo | openssl s_client -connect example.com:443 2>/dev/null | \
    openssl x509 -noout -dates

# Let's Encrypt renewal
sudo certbot renew
sudo certbot renew --dry-run  # test renewal

# Check certbot status
sudo systemctl status certbot.timer

# Force renewal
sudo certbot renew --force-renewal

# Auto-renewal cron job
# /etc/cron.d/certbot
0 */12 * * * root certbot renew --quiet --post-hook "systemctl reload nginx"

# Install new certificate (Let's Encrypt)
sudo certbot --nginx -d example.com -d www.example.com

# Check certificate chain
certbot certificates

# Verify SSL configuration
nginx -t  # check nginx config
sudo systemctl reload nginx

Error Information

Language

bash

Difficulty

Intermediate

Views

14

Related Errors