【发布时间】:2018-10-21 02:25:10
【问题描述】:
我有一个x.example,它为a.example 和b.example 提供流量。
x.example 拥有 a.example 和 b.example 的证书。 a.example 和 b.example 的 DNS 尚未设置。
如果我为a.example 添加一个指向x.example 的IP 的/etc/hosts 条目并运行curl -XGET https://a.example,我会得到200。
但是,如果我运行 curl --header 'Host: a.example' https://x.example,我会得到:
curl: (51) SSL: 没有替代证书主题名称与目标匹配 主机名 x.example
我认为它会使用 a.example 作为主机。也许我不明白 SNI/TLS 的工作原理。
因为a.example 是 HTTP 标头,TLS 握手还没有访问它的权限?但它确实有权访问的 URL 本身?
【问题讨论】: