![subjectAltName 中的主要‘通用名称’?](https://linux22.com/image/1261198/subjectAltName%20%E4%B8%AD%E7%9A%84%E4%B8%BB%E8%A6%81%E2%80%98%E9%80%9A%E7%94%A8%E5%90%8D%E7%A7%B0%E2%80%99%EF%BC%9F.png)
我有自己的 X.509 CA。在为主机颁发证书时,如果我有
Subject: .../CN=foobox.grawity.tld
- 和
subjectAltName: DNS:foobox.local
,
我还需要将其DNS:foobox.grawity.tld
作为 subjectAltName 吗?
(我注意到 Chrome 有时在错误消息中使用第一个 sAN 而不是主题通用名称。)
答案1
RFC 2818说:
If a subjectAltName extension of type dNSName is present, that MUST
be used as the identity. Otherwise, the (most specific) Common Name
field in the Subject field of the certificate MUST be used. Although
the use of the Common Name is existing practice, it is deprecated and
Certification Authorities are encouraged to use the dNSName instead.
这意味着如果 subjectAltName 存在,CN 将被忽略,所以是的,您确实需要添加 foobox.grawity.tld 作为 subjectAltName 条目。
答案2
通常,客户端希望看到它正在查看的主机名与 subjectDN.CommonName 或 subjectAltName 之间的完全匹配。