This question already has an answer here:

How can a IP address have SSL Certificate with different issud to and not showing SSL error?

The above CloudFlare's site is HTTPS enabled and showing in address bar. The certificate is issued to cloudflare-dns.com.

marked as duplicate by Deltik, Burgi, grawity, Moab, mtak Mar 15 at 15:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • It's kind of a duplicate, but it seems to focus more on policies (i.e. who is allowed to be a cert subject) rather than the technical side (how a certificate actually specifies its subject). – grawity Mar 15 at 14:11
  • 2
    @grawity: It's the same kind of confusion, though, since at the time, I only saw the *.cloudflare-dns.com Common Name in the Google Chrome Certificate Viewer and didn't know that there could be Subject Alternative Names for IP addresses. In the other question, the answers by Michael Frank and by me address this. – Deltik Mar 15 at 14:19

Certificates may have more than one name – X.509 v3 supports an extension called "Subject Alternative Name" or "subjectAltName". This extension contains a list of names, e.g. in this case:

DNS Name=cloudflare-dns.com
DNS Name=*.cloudflare-dns.com
DNS Name=one.one.one.one
IP Address=
IP Address=
IP Address=
IP Address=2606:4700:4700:0000:0000:0000:0000:1111
IP Address=2606:4700:4700:0000:0000:0000:0000:1001
IP Address=2606:4700:4700:0000:0000:0000:0000:0064
IP Address=2606:4700:4700:0000:0000:0000:0000:6400
IP Address=
IP Address=

In TLS, if this extension contains any DNS names or IP addresses, the certificate is valid for all of those names – and additionally it completely overrides the primary subject "CN" field.

In fact, the major web browsers have decided to require subjectAltName and completely ignore the subject "CN" (although only for commercial WebPKI certificates, not internal ones). It is likely that in the future WebPKI certificates will no longer have a CN field at all.

(One of the reasons for this switchover is that practically all systems support SAN, so the CN is practically never relevant anymore. Another is that subjectAltNames are strongly typed (each item is marked as a DNS domain, or an email address, or an IP address...) whereas the regular subject CN is freeform text and its meaning is system-dependent.)

  • I'm not sure that I'd expect Subject/CN to go away any time soon. It makes for a nice thing to print representing the certificate. – bartonjs Mar 15 at 15:06
  • @bartonjs: It won't go away for certificates in general, but it's outright misleading for TLS certificates when SAN is present, so in this situation I wouldn't call it "nice" in any way at all. Browsers can instead be taught to print the SAN list in the same format. (Consider e.g. CDNs with hundred-domain certificates, or OP's situation where the CN isn't actually the visited domain...) CA/B Forum's latest drafts already list it as "deprecated" and "discouraged". – grawity Mar 15 at 15:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.