小编use*_*017的帖子

在 openssl s_client 中使用“-servername”参数

我正在 Centos6/Apache 上安装新的 SSL 证书,而我的 Web 浏览器一直在获取旧证书。为了测试我的设置,我使用了“openssl s_client”,但我看到基于“-servername”参数的不同结果。在我们看来,没有人看到这个参数,它也没有出现在手册页中,但我看到这里提到了OpenSSL: Check SSL Certificate Expiration Date and More。

如果我运行这个命令:

echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -issuer -subject -dates

我得到了证书的正确日期。

(notBefore=Apr 20 00:00:00 2017 GMT notAfter=Apr 20 23:59:59 2018 GMT)

但是,如果我在命令中引入 -servername 参数

echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null | openssl x509 -noout -issuer -subject -dates

然后我得到浏览器显示的过期日期 -

(notBefore=Apr 20 00:00:00 2016 GMT notAfter=Apr 20 23:59:59 2017 GMT)

谁能解释为什么会发生这种情况,因为这一定与我的 SSL 证书在浏览器中显示为过期的原因有关。

谢谢哦

apache ssl openssl centos6

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

apache ×1

centos6 ×1

openssl ×1

ssl ×1