2013-10-30 174 views
1

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

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

有一段来自RFC 5280的名称约束第4.2.1.10节,同样的限制适用于alt扩展名。

“DNS名称限制被表示为host.example.com。可以通过简单地增加零个或多个标签来 名称的左手侧满足名称约束来构建任何DNS 名称。对于 例如,www.host.example.com将满足约束条件,但 host1.example.com不会。“

回答

5

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

3

您引用RFC 5280 (section 4.2.1.10)的部分不是关于主机名匹配当客户端连接到服务器时应该验证什么,这是关于如果使用名称约束扩展允许CA发布什么。

你以前看到的是用于HTTPS协议的特定协议,并在RFC 2818 (section 3.1)中定义。

RFC 6125更新,并且在应用协议中协调一致。 (这不一定是广泛实施。)

更具体地说,www.foo.com将不匹配foo.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中)。

+0

谢谢,这很有道理,RFC 6125说得很清楚。 – user2935019