问题是你试图使用一个过于宽泛的通配符(
*
或
*.com
).
规格(
RFC 6125
和
RFC 2818 Section 3.1
)谈论“
最左边
“标签,这意味着应该有多个标签:
1. The client SHOULD NOT attempt to match a presented identifier in
which the wildcard character comprises a label other than the
left-most label (e.g., do not match bar.*.example.net).
2. If the wildcard character is the only character of the left-most
label in the presented identifier, the client SHOULD NOT compare
against anything but the left-most label of the reference
identifier (e.g., *.example.com would match foo.example.com but
not bar.foo.example.com or example.com).
我不确定是否有一个规范来说明应该有多少最低标签,但
Chromium code
表示必须至少有2个点:
我们需要至少3个组件(即2个点)作为基本保护
反对过于宽泛的野蛮梳理。
这确实是为了防止像
*网站
。这可能看起来很不方便,但CA偶尔会犯错误,并且有措施防止潜在的流氓证书颁发给
*网站
上班不一定是件坏事。
如果我没记错的话,有些实现比这更进一步,并且有一个列表域,对于二级域来说也太宽了(例如。
.co.uk
).
关于第二个例子:“
CN:bar.com,SAN:DNS:my.foo.bar.com,DNS:yours.foo.bar.com
“。此证书的有效期应为
my.foo.bar.com
和
yours.foo.bar.com
但不是
bar.com
。当不存在SAN时,CN只是一个后备解决方案。如果有任何SAN,则应忽略CN(尽管有些实现会更宽容)。