openssl 工具无法从 CloudFront 获取证书,有人知道为什么吗?

mul*_*gon 3 ssl openssl amazon-cloudfront amazon-web-services

我正在编写一个脚本来检查SSL我所有域的到期日期。

这适用于我的普通网站:

echo | openssl s_client -connect $domain:443 2> /dev/null | openssl x509 -noout -enddate

但是它并没有为工作AWS CloudFront。我已将自己的证书上传到CF并正在使用CNAME.

输出是:

CONNECTED(00000003)
15336:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么?

我已经尝试过-ssl2-no_ssl3选项。

mul*_*gon 8

添加-servername $domain修复它:

openssl s_client -connect $domain:443 -servername $domain 2> /dev/null < /dev/null | openssl x509 -noout -enddate

非常感谢 Steffen Ullrich 对 Q 的评论。