大网数据广告活动
服务器运维问答

ssl certificate self signed instead of valid

· 52CE 我爱测

I've purchased a valid certificate: For example this site validates it: https://sslanalyzer.comodoca.com/?url=www.example.com But when I test it with openSSL, like this: openssl s_client -showcerts -connect https://www.example.co…

问题原文

原帖链接 · Aleksandar Pavić · CC BY-SA 3.0

I've purchased a valid certificate:

For example this site validates it: https://sslanalyzer.comodoca.com/?url=www.example.com

But when I test it with openSSL, like this:

openssl s_client -showcerts -connect https://www.example.com:443

I get

Verify return code: 18 (self signed certificate)

社区高分解答

原帖链接 · StackzOfZtuff · CC BY-SA 3.0

SNI-Hole

You've fallen into a SNI hole.

SNI is server name indication. This allows you have multiple different hostnames living on the same shared IP. And if you don't actually indicate a servername to a SNI enabled server, then you get back the default certificate. (This is the "SNI hole" part.)

And OpenSSL will not supply a servername to the TLS server unless you tell it to. Use the -servername parameter for that.

$ echo '' | openssl s_client -showcerts -connect www.unival-logistics.com:443  -servername www.unival-logistics.com 2>/dev/null | grep -Ei 'subject|issuer|return'
subject=/C=US/OU=Domain Control Validated/CN=www.unival-logistics.com
issuer=/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Domain Validation CA - SHA256 - G2
    Verify return code: 20 (unable to get local issuer certificate)

If you leave that out, then you get the default certificate for that host. And here that is a self-signed certificate. (And I don't think it should be there either. Makes no sense to deliver a self-signed cert.)

 $ echo '' | openssl s_client -showcerts -connect www.unival-logistics.com:443  2>/dev/null | grep -Ei 'subject|issuer|return'
 subject=/O=americanfuturegate.com/CN=*.americanfuturegate.com/emailAddress=[email omitted]
 issuer=/O=americanfuturegate.com/CN=*.americanfuturegate.com/emailAddress=[email omitted]
     Verify return code: 18 (self signed certificate)

Check that installation

Side note: I urge you to disable SSL3. (SSL Labs report here.)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-10-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。