NET::ERR_CERT_COMMON_NAME_INVALID

DIRECT ANSWER
`NET::ERR_CERT_COMMON_NAME_INVALID` means the HTTPS certificate returned by the server does not cover the exact hostname in the address bar. Inspect the certificate’s Subject Alternative Names (SANs), then check DNS, hosting, CDN, load-balancer, and SNI configuration if the wrong certificate is being served.
Key takeaways
- This is a hostname mismatch: the certificate’s Common Name or SAN list does not cover the requested hostname.
- Inspect the certificate first to determine whether the hostname is missing or the wrong endpoint is responding.
- A certificate for the bare domain does not automatically cover every subdomain, including
www. - Incorrect A, AAAA, or CNAME records can direct visitors to an endpoint with another site’s certificate.
- CDN, load-balancer, shared-hosting, and SNI configuration must select a certificate for the exact hostname.
Site Administrator
What this error means & how to recognize it
- Chrome or Edge displays “Your connection is not private” with
NET::ERR_CERT_COMMON_NAME_INVALID. - The certificate details show a Common Name or Subject Alternative Name for a different hostname.
- The bare domain works, but a particular subdomain fails.
- The error starts after adding a subdomain, changing DNS, moving hosting, or enabling a CDN or load balancer.
- A shared server or CDN presents a default, placeholder, or unrelated certificate.
- Some users or networks see the error while others do not, often indicating different IPv4, IPv6, DNS, or edge-routing paths.
Root causes, ordered by likelihood
- The certificate does not include the requested hostname. The failing hostname may be absent from the certificate’s SAN list. A wildcard can cover some subdomains, but its scope must match the requested name.
- The server is serving its default certificate. Shared hosting may not have the certificate assigned to the domain, or SNI and HTTPS virtual-host selection may be incorrect.
- A CDN or load balancer has the wrong edge certificate. The hostname may not be configured on the service, or the request may reach a default listener or edge configuration.
- DNS points to the wrong endpoint. An incorrect A, AAAA, or CNAME record can send the request to a server that presents a certificate for another site. An incorrect AAAA record can affect IPv6 users even when IPv4 works.
- A migration or domain change left services out of sync. DNS, the CDN, origin server, and certificate may each be configured for different hostnames or endpoints.
How to fix it
1. Identify the exact hostname and certificate mismatch
Check the complete hostname in the address bar, including every subdomain. Open the browser’s certificate details and inspect the Common Name and Subject Alternative Names (SANs). The requested hostname must appear in the SAN list or match an applicable wildcard pattern.
For a command-line check, set the variable to the hostname you are testing:
HOSTNAME='[your hostname]'
openssl s_client -connect "$HOSTNAME:443" -servername "$HOSTNAME" </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltNameThe -servername option sends the hostname through SNI, which is important on shared HTTPS infrastructure. Run diagnostic commands before making configuration changes.
2. Add the hostname to the certificate
If the certificate covers the bare domain but not the failing subdomain, reissue or replace it with one that includes the required hostname as a SAN. A wildcard certificate may cover multiple one-level subdomains, but confirm coverage for the bare domain and any deeper subdomains separately.
If using Certbot, first confirm that you are authorized to request and deploy a certificate for the domain, that the webroot is correct, and that the validation method is suitable for the server. Include every required name in the issuance request:
DOMAIN='[your bare domain]'
SUBDOMAIN='[your subdomain]'
certbot certonly --webroot -w '[your webroot]' -d "$DOMAIN" -d "$SUBDOMAIN"This obtains a certificate but does not by itself install or activate it. Use the issuance method and webroot appropriate for the server, then install the certificate on the endpoint that terminates HTTPS and assign it to the correct hostname.
3. Check shared hosting and origin-server configuration
In the hosting control panel, confirm that a certificate is installed and assigned to the exact domain or subdomain. On a shared server, ask the provider to verify SNI-based certificate selection and the HTTPS virtual-host configuration.
Reload or restart the web server only after confirming the certificate files, permissions, and configuration are correct. A reload or restart can interrupt service, so follow the provider’s change procedure and obtain the required authorization before applying it.
4. Check CDN and load-balancer certificate coverage
Verify that the exact hostname is configured on the CDN or load balancer and included in its edge certificate. Confirm that the hostname routes to the intended origin as well.
If the CDN terminates HTTPS, the origin certificate alone does not resolve a browser mismatch. The certificate served by the public edge endpoint must cover the hostname. If the CDN passes HTTPS through, inspect the certificate at the origin instead.
5. Verify DNS for IPv4 and IPv6
Compare the hostname’s A, AAAA, and CNAME records with the endpoint or target supplied by the hosting or CDN provider. Check whether the failing network uses IPv4 or IPv6 and whether both paths reach the intended service.
Correct stale or unintended records only after confirming the intended endpoint and the appropriate DNS change procedure. Check the result from the affected network because cached DNS responses may persist until their TTL expires.
6. Re-test the same HTTPS hostname
After changing certificate assignment, routing, or DNS, test the exact URL that failed. Inspect the returned certificate again and confirm its SAN list, issuer, and validity dates. Test from the affected network as well as from the hosting, CDN, or server environment to distinguish propagation or resolver differences from an active misconfiguration.
Prevention & how to verify the fix
- Include certificate coverage whenever you add a subdomain, change DNS, migrate hosting, or add a CDN.
- Use SAN coverage or an appropriately scoped wildcard only after checking the bare domain, one-level subdomains, and deeper names the service actually uses.
- Keep DNS records, CDN hostnames, load-balancer listeners, origin virtual hosts, and certificate assignments aligned.
- Test both A and AAAA paths after DNS changes.
- Inspect the certificate served by the public endpoint instead of relying only on the absence of a browser warning.
- Record which service terminates HTTPS so certificate changes are made at the correct layer.
- Maintain certificate renewal and deployment procedures that include every required hostname.
When to get outside help
Contact the hosting provider, CDN team, or load-balancer administrator when the public endpoint still serves the wrong certificate after the hostname, DNS records, and certificate assignment appear correct. Provider-controlled SNI, virtual-host routing, edge certificate provisioning, or DNS settings may require access you do not have.
Provide the exact failing hostname, the certificate names shown by the browser or command-line check, and the relevant A, AAAA, or CNAME results. Escalate promptly if the mismatch affects a production or login hostname, because users cannot safely establish HTTPS trust until the endpoint serves the correct certificate.
Frequently asked questions
Does a certificate for the bare domain cover its www hostname?
Not automatically. The www hostname must be listed in the certificate’s SANs or covered by an applicable wildcard certificate. Inspect the certificate rather than assuming both names are included.
Does a wildcard certificate cover the bare domain?
Generally not. A wildcard for one-level subdomains is normally separate from the bare domain, which needs its own certificate coverage.
Can a wildcard certificate cover a deeper subdomain?
Not necessarily. A wildcard for one level, such as *.your-domain, generally does not cover a name with additional levels. Check the certificate’s actual SANs and wildcard scope for the hostname being requested.
Why does the main domain work while a subdomain fails?
The two hostnames may use different certificates, servers, CDN configurations, or DNS records. Compare the failing hostname with the certificate SAN list and its A, AAAA, and CNAME results.
Can incorrect DNS cause NET::ERR_CERT_COMMON_NAME_INVALID?
Yes. If DNS sends the request to another server, that endpoint may return a certificate for a different hostname. Check both IPv4 and IPv6 records.
What if the correct certificate is installed but the error remains?
Confirm that it is assigned to the exact HTTPS virtual host or CDN hostname, that SNI selects it, and that both IPv4 and IPv6 reach the intended endpoint. A default certificate at one layer can remain active even when the correct certificate exists elsewhere.
Further documentation
For authoritative implementation details, consult the documentation for the browser used to inspect certificate names, the certificate authority or ACME client used to issue the certificate, and the relevant hosting, CDN, load-balancer, and DNS providers. Focus on their guidance for Subject Alternative Names, wildcard scope, SNI certificate selection, hostname provisioning, DNS record changes, certificate deployment, and renewal.