Skip to content

SSL Certificate 错误

快速摘要

你的 HTTPS site shows security 警告因为 SSL certificate 是无效, expired, or misconfigured.

为什么发生

  • SSL certificate 有 expired

  • certificate 是 for 不同领域 (name mismatch)

  • certificate 是 self-signed and 不 trusted 通过浏览器

  • 服务器是 missing 中级 certificates in 链

最小示例

✗ 错误代码
// Browser error: NET::ERR_CERT_DATE_INVALID
// Certificate expired on 2026-01-01
https://example.com → Security warning
✓ 修复代码
// Renew certificate and install full chain
// Using Let's Encrypt:
// certbot certonly --webroot -w /var/www -d example.com -d www.example.com
// Auto-renew: certbot renew --dry-run

Renew expired certificate and 安装完整链 (包含中级 certificates). Let's Encrypt provides free certificates 使用 auto-renewal.

如何诊断

  • 点击浏览器警告到 see 特定错误 (NET::ERR_CERT_DATE_INVALID, etc.)

  • Use SSL checker tool (e.g., ssllabs.com) 到 diagnose certificate

  • 检查 certificate expiration date and 领域 names

如何修复

  • Renew expired certificate 使用你的 certificate authority

  • Ensure certificate covers 正确领域 (包含 www)

  • 安装完整 certificate 链包含中级 certificates

  • Use Let's Encrypt for free, auto-renewing certificates

如何预防

  • 设置 automatic certificate renewal (e.g., certbot auto-renew)

  • Monitor certificate expiration dates

  • Use CDN or hosting provider 那个 manages SSL certificates

相关资源

相关术语

相关课程

← 返回语言