为什么 play.google.com 仅与 SNI = google.com 进行握手

为什么 play.google.com 仅与 SNI = google.com 进行握手

无法打开https://play.google.com在我的 Mac(Safari 和 Chrome)上出现 ERR_TIMED_OUT,但可以在其他笔记本电脑上打开。看起来服务器没有回复 ClientHello,因此 SNI 与主机相同。

$> openssl s_client -connect play.google.com:443 -servername play.google.com
CONNECTED(00000006)
...endless loading here

仅当我设置 SNI google.com 时才有效

$> openssl s_client -connect play.google.com:443 -servername google.com
CONNECTED(00000006)
depth=3 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
verify return:1
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = *.google.com
verify return:1
---
Certificate chain
 0 s:/CN=*.google.com
   i:/C=US/O=Google Trust Services LLC/CN=GTS CA 1C3
 1 s:/C=US/O=Google Trust Services LLC/CN=GTS CA 1C3
   i:/C=US/O=Google Trust Services LLC/CN=GTS Root R1
 2 s:/C=US/O=Google Trust Services LLC/CN=GTS Root R1
   i:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA
---

答案1

仅当我设置 SNI 时才有效

如今,网站需要 SNI 的情况相当普遍,即所有网站都是具有不同证书的多个域名,托管在同一个 IP 上 - 就像 Cloudflare 背后的所有内容一样。

... 其他设备可以连接。

我假设您的意思是您可以从其他设备连接而无需明确给出-servername选项。在 s_client 中使用 SNI 是较新版本的 openssl 的默认设置,但它们有一个-noservername选项可以关闭此默认设置。因此,您可能在不同的系统上使用不同版本的 openssl。请检查openssl version

相关内容