在ssl证书中匹配域名

时间:2013-10-30 06:15:24

标签: ssl dns domain-name mismatch

我一直在通过X.509 RFC,我遇到了域名匹配约定的问题。

域名“www.foo.com”是否应与ssl证书中的“foo.com”和“.foo.com”域名匹配?请注意,没有通配符。

RFC 5280中有一段4.2.1.10节的名称约束,同样的限制适用于alt name extentions。

“DNS名称限制表示为host.example.com。任何DNS    只需添加零个或多个标签即可构建的名称    名称的左侧满足名称约束。对于    例如,www.host.example.com将满足约束条件但是    host1.example.com不会。“

2 个答案:

答案 0 :(得分:5)

不幸的是,如果您拥有“www.foo.com”证书,除非您的证书提供商(或CA)指定,否则它不会自动用于“foo.com”。之前也有同样的问题。检查精美的印刷品,应该列为“保护您的www和非www”或联系他们的支持并询问应该如何完成

答案 1 :(得分:4)

您引用RFC 5280 (section 4.2.1.10)的部分与客户端在连接服务器时应验证的内容无关,而是关于在使用名称约束时允许哪些CA发出的问题扩展

您曾经认为是特定于协议的,并且在RFC 2818 (section 3.1)中为HTTPS定义。

RFC 6125更新,并且在应用程序协议之间进行协调。 (它未必广泛实施。)

更具体地说,www.foo.comfoo.com.foo.com不匹配:

6.4.1. Checking of Traditional Domain Names


   If the DNS domain name portion of a reference identifier is a
   "traditional domain name", then matching of the reference identifier
   against the presented identifier is performed by comparing the set of
   domain name labels using a case-insensitive ASCII comparison, as
   clarified by [DNS-CASE] (e.g., "WWW.Example.Com" would be lower-cased
   to "www.example.com" for comparison purposes).  Each label MUST match
   in order for the names to be considered to match, except as
   supplemented by the rule about checking of wildcard labels
   (Section 6.4.3).

通常,如果您希望证书对www.foo.comfoo.com有效,则需要有多个主题备用名称(foo.com不涵盖*.foo.com }})。

相关问题