我正在尝试使用 OpenSSL 来验证 SSL 证书是否仍然有效,但我不断收到奇怪的结果。我正在测试的示例站点 (expired.badssl.com) 的 SSL 证书已过期。
Firefox 将此标记为 2015 年 4 月过期并显示相关警告,但是当我查看使用 OpenSSL s_client 提供的证书信息时,它说它在 2016 年之前仍然有效:
$ (echo "" | openssl s_client -connect expired.badssl.com:443 -CApath /etc/ssl/certs/ca-certificates.crt) | openssl x509 -noout -dates
[...]
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.badssl.com
verify return:1
DONE
notBefore=Apr 9 00:00:00 2015 GMT
notAfter=Jul 7 23:59:59 2016 GMT
我怀疑我在这里遗漏了一些东西,但我无法弄清楚它是什么。