Chrome, Edge and other Chromium browsers浏览器
错误信息
net::ERR_CERT_DATE_INVALID
警告页显示“NET::ERR_CERT_DATE_INVALID”;自动化工具打印的是“net::ERR_CERT_DATE_INVALID”。如果 Chrome 判断是设备时钟本身有误,就会显示专门的“Your clock is ahead/behind”页面,而不是通常的警告。
Chrome, Edge and other Chromium browsers — the certificate is expired or not yet valid
含义
按照设备时钟,该网站的证书(或其证书链中的某张证书)不在有效期内:已过期或尚未生效。Chrome 会用“Your connection is not private”拦截页面。如果只有一个网站出现这个错误,说明该网站的证书已过期;如果所有网站都出现,说明电脑的日期不对。
原因
网站证书已过期
常见续期失败,或者从未实现自动化。公共证书的最长有效期正在缩短(2026年3月起为 200 天,2029年将缩短至 47 天),因此手动续期已经行不通了。
设备日期不正确
常见CMOS 电池耗尽、双系统启动时的时区混乱以及手动设置的时钟,都会让有效的证书看起来已过期或尚未生效。
服务器仍未使用续期后的证书
偶见续期后,Web 服务器、负载均衡器或 CDN 仍在使用旧证书。
修复方法
- 1.
网站所有者:检查实际发送的证书日期
将 notAfter 与今天的日期比较;从外部、通过访客使用的同一路径进行检查。
bash echo | openssl s_client -connect www.example.com:443 -servername www.example.com 2>/dev/null \ | openssl x509 -noout -startdate -enddate - 2.
网站所有者:续期并实现自动化
续期证书,重新加载负责 TLS 终止的服务,并确认自动续期任务确实存在且在运行。
bash sudo certbot renew && sudo systemctl reload nginx systemctl list-timers | grep -i certbot # is automatic renewal scheduled? - 3.
用户:校正设备时钟
启用自动设置时间;不要绕过警告,因为过期的证书已经不能再用来可靠地确认网站身份。
text Users: if many sites show this error at once, fix the device clock first (Windows: Settings → Time & language → Set time automatically; macOS: Date & Time → Set automatically).