即使 SNI 与服务器证书主题名称匹配,TLS 握手主机名也不匹配

TLS handshake hostname mismatch even when SNI matches with server-certificate subject name

我在服务器证书验证步骤中在客户端遇到主机名不匹配错误:-“验证 return 代码:62(主机名不匹配)”。

但是我能够看到在 SNI 扩展中的 Client-hello 中发送的主机名与服务器证书的主题名称(通用名称)相匹配:-

SNI extension in client-hello;-

    extension_type=server_name(0), length=18
      0000 - 00 10 00 00 0d 54 4c 53-2d 55 6e 69 74 2d 54   .....TLS-Unit-T
      000f - 65 73 74                                       est
    extension_type=ec_point_formats(11), length=4

Server-certificate common-name:-

    Subject: C = IN, ST = KA, L = Bangalore, O = Cisco, CN = TLS-Unit-Test

主题字段是 deprecated。正确的 TLS 客户端根本不查看此字段,而是检查 SAN 扩展。 SAN 扩展名必须包含证书有效的所有域名。