Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

NET::ERR_CERT_COMMON_NAME_INVALID: the name on the certificate does not match

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Chrome reports NET::ERR_CERT_COMMON_NAME_INVALID when the certificate presented for the connection does not name the host you asked for. Chromium defines that fault as NET_ERROR(CERT_COMMON_NAME_INVALID, -200). Read the names on the certificate and the exact host in the address bar before you renew anything.

What the symptom means

Chromium's net_error_list.h states:

The server responded with a certificate whose common name did not match the host name. This could mean:

  1. An attacker has redirected our traffic to their server and is presenting a certificate for which they know the private key.
  1. The server is misconfigured and responding with the wrong cert.
  1. The user is on a wireless network and is being redirected to the network's login page.
  1. The OS has used a DNS search suffix and the server doesn't have a certificate for the abbreviated name in the address bar.

Chrome Help groups certificate, privacy and invalid-name failures on one page. It does not redefine -200. Use the code Chrome prints and Chromium's four causes. For the full code list, Chrome Help points to chrome://network-errors/.

A date problem is NET::ERR_CERT_DATE_INVALID. An untrusted issuer is NET::ERR_CERT_AUTHORITY_INVALID.

Likely causes

Cause What you see How to confirm
Wrong certificate on the virtual host One hostname fails; another on the same IP works Certificate subject or SAN list omits the failing name
Captive portal redirect Failures on guest Wi-Fi until you sign in Chromium cause 3; open http://example.com
DNS search suffix abbreviated the name Short name in the address bar; certificate has only the FQDN Chromium cause 4; compare short name with certificate SANs
DNS or redirect to the wrong host Certificate names a different site entirely Resolve the name; compare with the certificate
Wrong virtual-host certificate after a zone or host change (this article's own reasoning) New hostname points somewhere that serves another site's certificate Zone layout; see wrong SSL certificate served (SNI / default virtual host) and CNAME at the zone apex when the apex itself is the problem

Prove the cause before changing anything

All of these are read-only.

1. Read the exact code. Confirm NET::ERR_CERT_COMMON_NAME_INVALID.

2. Copy the host from the address bar exactly, including whether it is a short name or a fully qualified name.

3. Open the certificate details in Chrome for that connection. Read the subject and every DNS name in the subject alternative name list. The host you requested must appear there (or match a permitted wildcard that the certificate actually contains). Chromium's wording still says "common name"; that modern certificates carry the usable names in the SAN list is general certificate practice, not a statement on either cited page.

4. Captive portal check. Chrome Help Step 1:

Go to any website that starts with "http://," like http://example.com.

Then sign in on that page if a portal appears. Chromium's third cause is the wireless login redirect.

5. Search-suffix check. If the address bar shows a short label such as intranet while the certificate only names intranet.example.com, you are looking at Chromium's fourth cause. Try the fully qualified name in the address bar without changing DNS yet.

6. Incognito. Chrome Help Step 2: open the page in an Incognito window to reduce extension interference while you compare names.

Fix

Captive portal

Complete the network sign-in on the HTTP portal page. No certificate on the destination site needs changing for that case. Reload the original HTTPS URL after the portal accepts you.

Short name and search suffix

Prefer the fully qualified hostname that appears on the certificate. If staff must keep using a short name, the certificate has to include that short name, or the search suffix path has to produce a name the certificate already covers.

Save the current search-suffix or hosts configuration your operating system shows before you change it (the exact panel or file depends on the OS). Write the values the device shows into a note you control:

echo "search=<values the device shows> short_name=<name in the address bar>" > name-resolution-before.txt

Risk: the next step changes how the device expands short host names (search suffix, hosts file or equivalent). A wrong suffix can send short names to unexpected hosts and make other internal names fail until you restore the saved values.

Adjust the search suffix or publish a certificate that includes the name people type, following your organisation's DNS and certificate process. Prefer fixing the name people type so it matches an existing SAN over teaching every laptop a new suffix.

To undo it: put the search-suffix or hosts values from name-resolution-before.txt back.

Wrong certificate on the server

When every client fails for the same FQDN and the certificate simply omits that name, install a certificate that includes it on the TLS terminator for that virtual host.

Save the live certificate and key files first (paths vary; use the paths your server actually uses):

cp /etc/ssl/example.com/fullchain.pem fullchain-before.pem
cp /etc/ssl/example.com/privkey.pem privkey-before.pem

Risk: the next step replaces the TLS certificate and private key files the web server uses and reloads the web server. A mismatched key or incomplete chain takes HTTPS down for every hostname that shares that pair until you restore the previous files.

Install the certificate that names the failing host, point the server at those files, test the configuration, and reload with your normal process.

To undo it: copy fullchain-before.pem and privkey-before.pem back to the live paths and reload the web server again.

Example (illustrative): Staff open https://files on office Wi-Fi. The search suffix expands the request in a way that hits a host whose certificate only lists files.example.com, and Chrome shows NET::ERR_CERT_COMMON_NAME_INVALID. Opening https://files.example.com succeeds; the durable fix is either that FQDN in bookmarks or a certificate that also covers the short name the address bar shows.

Confirm the fix

  1. Chrome loads the URL without the common-name interstitial.
  2. The certificate details include the host shown in the address bar.
  3. A second device on the same network agrees.

What to watch afterwards

  • After adding a hostname, reissue or replace the certificate so the new name is in the SAN list before you publish DNS.
  • Guest Wi-Fi portals keep producing Chromium's third cause until users sign in.
  • A name mismatch is not cured by trusting a new CA; that path is the authority-invalid article.

Risks and limits

  • Ignoring Chromium's attacker-redirect cause and clicking through a name mismatch teaches the browser to accept the wrong host.
  • Chromium's four causes live in net_error_list.h; Chrome Help groups this code with other certificate errors without reprinting that numbered list.
  • Wildcard certificates still have to match the host Chrome requested; that a certificate for *.example.com does not cover a different registered domain is general certificate practice, not a statement on either cited page.

Sources