Why Does My Subdomain Show a Certificate Name Error?

When a browser shows a warning such as NET::ERR_CERT_COMMON_NAME_INVALID, "Your connection is not private" or "certificate name mismatch" on a subdomain, it nearly always means the certificate the server presented does not list that exact host name in its Subject Alternative Name (SAN) field. Common reasons are that the certificate was issued only for the main domain, that a wildcard does not reach a deeper subdomain, that the server is presenting a default certificate because it has no site configured for that name, or that a CDN or hosting platform has not finished issuing a certificate for the new name. The fix is to get a certificate that covers the name and make sure the server serving that name actually uses it.

How browsers decide whether a certificate matches

Modern browsers compare the host name in the address bar with the DNS names in the certificate's SAN extension. They no longer rely on the older Common Name field. A match must be exact, apart from a wildcard in the left-most position, which covers exactly one label. So a certificate for example.com does not cover shop.example.com, and *.example.com covers shop.example.com but not api.shop.example.com or example.com itself. The card on multi-level subdomains explains the one-label rule.

The usual causes

CauseHow it shows upTypical fix
Certificate covers only the apex or wwwSAN list has example.com and www.example.com onlyReissue with the subdomain added, or issue a separate certificate
Wildcard does not reach the levelName is two levels down from the wildcardAdd the exact name or a deeper wildcard
No site configured for the nameServer returns its default site's certificateAdd a virtual host or site for the subdomain with its own certificate
Certificate still being issuedNew name on a CDN or platform shows the provider's certificate for a whileWait for issuance to complete; check that DNS validation records are correct
DNS points somewhere unexpectedCertificate belongs to a different service entirelyCorrect the A, AAAA or CNAME record
Expired or not-yet-valid certificateDifferent error, such as ERR_CERT_DATE_INVALIDRenew, and check server clocks

Checking what the server presents

  1. In the browser, open the certificate viewer from the address bar and read the list of names. The notes on debugging subdomains with browser developer tools show where to find it.
  2. From a terminal, ask the server directly, sending the right name with SNI: openssl s_client -connect shop.example.com:443 -servername shop.example.com, then inspect the certificate's subject and SAN entries in the output.
  3. Check DNS, with dig shop.example.com, to confirm the name points where you expect.
  4. Look at certificate transparency logs, which publicly record certificates issued by public authorities, to see whether a certificate for the name has been issued at all. The background paper on certificate transparency explains how these logs work and what they reveal.

Why the server sends the wrong certificate

A single server often hosts many names on one IP address. During the TLS handshake the browser sends the requested name using Server Name Indication (SNI), and the server picks the matching site and certificate. If no site is configured for shop.example.com, the server falls back to its default site and presents that site's certificate, hence the mismatch. The same fallback explains why a new subdomain sometimes shows the main website instead of the new content. Configuring a dedicated site for the subdomain fixes both. The guide to pointing a subdomain at your own server covers this setup.

Getting a certificate that covers the name

Do not train people to click through

It is tempting to tell colleagues to "just click Advanced and proceed" while a certificate is fixed. Avoid it. A certificate warning is exactly what users should stop for when an attacker is intercepting traffic, and teaching people to ignore it undermines that protection. If the subdomain uses HSTS, browsers will not offer a click-through at all. Fix the certificate instead.

After the fix: a short checklist

Frequently asked questions

Does my main domain's certificate cover subdomains?

Only if they are listed in it, either by exact name or through a wildcard for that level.

Why does the subdomain work on one network but not another?

Often DNS caching: one resolver still returns an old address that serves a different certificate. Check the answer from each network.

Is "not secure" always a certificate name problem?

No. It can also mean the page loads over HTTP, or that an HTTPS page includes insecure content. Check the exact message.

The SubDoms study hub places this card in the HTTPS module.

← Back to Home