How do Common Names (CN) and Subject Alternative Names (SAN) work together?

前端 未结 3 1734
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 15:17

Assuming the Subject Alternative Name (SAN) property of an SSL certificate contains two DNS names

  1. domain.tld
  2. host.domain.tld<
3条回答
  •  失恋的感觉
    2020-12-07 16:00

    CABForum Baseline Requirements

    I see no one has mentioned the section in the Baseline Requirements yet. I feel they are important.

    Q: SSL - How do Common Names (CN) and Subject Alternative Names (SAN) work together?
    A: Not at all. If there are SANs, then CN can be ignored. -- At least if the software that does the checking adheres very strictly to the CABForum's Baseline Requirements.

    (So this means I can't answer the "Edit" to your question. Only the original question.)

    CABForum Baseline Requirements, v. 1.2.5 (as of 2 April 2015), page 9-10:

    9.2.2 Subject Distinguished Name Fields
    a. Subject Common Name Field
    Certificate Field: subject:commonName (OID 2.5.4.3)
    Required/Optional: Deprecated (Discouraged, but not prohibited)
    Contents: If present, this field MUST contain a single IP address or Fully-Qualified Domain Name that is one of the values contained in the Certificate’s subjectAltName extension (see Section 9.2.1).

    EDIT: Links from @Bruno's comment

    RFC 2818: HTTP Over TLS, 2000, Section 3.1: Server Identity:

    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.

    RFC 6125: Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS), 2011, Section 6.4.4: Checking of Common Names:

    [...] if and only if the presented identifiers do not include a DNS-ID, SRV-ID, URI-ID, or any application-specific identifier types supported by the client, then the client MAY as a last resort check for a string whose form matches that of a fully qualified DNS domain name in a Common Name field of the subject field (i.e., a CN-ID).

提交回复
热议问题