How to Fix an SSL Certificate Name Mismatch
A certificate name mismatch means the hostname in the address bar is not on the certificate. Here is how to find the cause and put the right names on the right server.
10 min readUpdated Nov 21, 2026By XPASS Editorial Team

You type your address, press enter, and the browser refuses to continue. The warning says the certificate was issued for a different name, or the connection is not private. If you open the details, the certificate looks fine: it is valid, it comes from a respected authority, and it is not expired. But the name on it is not the name you visited. This is a certificate name mismatch, and it is one of the easiest SSL problems to understand and fix once you know where to look.
This guide explains how browsers compare names, the common reasons a mismatch happens, and how to repair each case. It is useful for site owners, freelancers and anyone who manages several domains and subdomains. If your warning is about the issuer instead, read fixing ERR_CERT_AUTHORITY_INVALID, and if it mentions dates, see ERR_CERT_DATE_INVALID. Those are separate checks that happen in addition to the name check.
How browsers match names
A certificate does not just say "this is a good certificate". It says "this certificate is for these specific names". When a browser connects to shop.example.com, it asks: is shop.example.com on the certificate the server just showed me?
The names live in a field called Subject Alternative Name (SAN). The structure is defined in RFC 5280, and modern browsers rely on the SAN list. The older "Common Name" field is no longer enough on its own in current browsers, so it is the SAN list that you should read. A certificate may list one name or many, and the names can be exact hostnames or wildcard patterns.
The match rules are strict:
- Exact names must match completely. A certificate for
example.comdoes not automatically coverwww.example.com, and the reverse is also true. Each must be listed. - Wildcards cover one label only.
*.example.commatcheswww.example.comandshop.example.com, but notexample.comitself and nota.b.example.com. - Comparison ignores letter case in hostnames but nothing else. A different spelling is a different name.
- The comparison is against what you typed, after any redirect-free connection. The name used to open the TCP connection is what counts for that handshake.
If no name on the certificate matches, the browser shows a name mismatch warning. In Chrome and Edge this commonly appears as NET::ERR_CERT_COMMON_NAME_INVALID, and other browsers use their own wording.

How the server decides which certificate to show
Many websites share one IP address. The server needs a way to know which site you want before it sends a certificate, and it does this through Server Name Indication (SNI), a field the client puts in the first message of the TLS handshake, as described in RFC 8446 for TLS 1.3. The server reads the name, picks the matching certificate and sends it.
If the name is missing or unknown, the server falls back to a default certificate. That default may belong to a completely different site. So a mismatch can have two broad origins: the certificate truly does not include your name, or the server picked the wrong certificate because it did not know which one to choose.
Step 1: Read the names on the certificate
Start by collecting the facts.
- Click the warning details or the padlock, and open the certificate viewer.
- Find the Subject Alternative Name list. Write down all the names.
- Compare the exact address in the address bar with that list, character by character. Look for a missing
www, a different subdomain, a different top-level domain, or a typo.
With OpenSSL you can print the SAN list directly:
echo | openssl s_client -connect www.example.com:443 -servername www.example.com 2>/dev/null | openssl x509 -noout -ext subjectAltName
Run it twice if you suspect an SNI issue: once with -servername and once without. If the two runs show different certificates, the server is choosing a certificate based on the name, and the default one is wrong for your site.
Step 2: Identify the pattern
Once you know the names, the cause is usually one of the following.
The bare domain and the www host are not both covered
The certificate lists www.example.com but not example.com, or the reverse. Visitors who type the other form get the warning. This is very common after a certificate is ordered for only one of the two.
Fix: reissue the certificate so that both names are on it, and install the new one. Also make sure your redirect from one form to the other happens only after a valid TLS connection, because the browser checks the certificate before it ever sees the redirect.
A wildcard does not reach as deep as expected
A certificate for *.example.com is correct for blog.example.com and wrong for example.com and for staging.blog.example.com.
Fix: add the missing names to the certificate, or issue another certificate for the deeper level, such as *.blog.example.com.
A new subdomain was added without a certificate
Someone created app.example.com in DNS and pointed it at a server, but the server still shows the certificate for www.example.com.
Fix: add the new name to the certificate or request a separate one, install it for that virtual host, and reload the service.
The domain points to the wrong server
If the DNS record sends the hostname to a different machine from the one that holds your certificate, the visitor gets whatever certificate that machine shows. This often happens after a migration, when an old IP address is still in DNS or one record was changed and another was not.
Fix: look up the A and AAAA records for the name and confirm that they point where you expect. Remember that DNS caches can keep old answers for a while after a change. If you have both IPv4 and IPv6 records, test both, because a visitor on IPv6 may reach a different server from one on IPv4.
The visitor opened the site by IP address or by another hostname
Typing https://203.0.113.10 or using an internal machine name does not match a certificate issued for your public hostnames. Publicly trusted certificates are issued for names that are validated, so an arbitrary address will not match.
Fix: use the public hostname. If a tool or script must connect by IP, configure it to send the correct hostname for the TLS name check, rather than turning verification off.
SNI is not being sent or the server lacks the right virtual host
Very old clients, some embedded tools and some scripts do not send SNI. The server then returns its default certificate. Alternatively, the web server may simply have no virtual host configured for that name, so the default applies.
Fix: add a dedicated virtual host and certificate for the name, and ensure that the default site on the server uses a sensible certificate. For clients that do not send SNI, you may need a different arrangement, such as a dedicated address, if you must support them.
A CDN or proxy sits in front of the site
Services that sit between visitors and your server present their own certificate to visitors, and a separate connection goes to your server. A mismatch can occur if the name was not set up on the service, or if the service is connecting to your server using the wrong hostname.
Fix: add the hostname inside the service's settings, confirm which certificate it presents, and verify that the origin server has a certificate for the name it is asked for.
Step 3: Fix and verify
Once you know the cause, the repair follows a standard order.
- Decide the full list of names. Write down every hostname visitors use: bare domain,
www, and any subdomains. Think about mail, admin and API hostnames too. - Request or reissue the certificate with all those names. If you are creating a new request, review the guide to generating a CSR and private key safely, and make sure each name is entered exactly.
- Complete the validation. Authorities check that you control each name, commonly through a DNS record or a file on the site.
- Install the certificate and the intermediates on the right server or virtual host.
- Reload the service.
- Test every name with the browser and with OpenSSL, using
-servernamefor each. Check that the SAN list includes the name and that the verify return code is 0.
If the process of ordering, validating and installing is new to you, Let's Encrypt's overview shows the same idea in plain language, regardless of which provider you use.
A worked example
A designer runs a portfolio at example.com and a client area at clients.example.com. A client reports a warning when opening the client area.
- The designer opens the page and clicks the warning. The certificate lists only
example.comandwww.example.com. - The address in the bar is
clients.example.com, which is not on the list. That is the mismatch. - A check of DNS shows that
clients.example.comcorrectly points to the same server as the main site, so the problem is only the certificate. - The designer reissues the certificate with three names:
example.com,www.example.comandclients.example.com, installs it and reloads the web server. - OpenSSL with
-servername clients.example.comnow prints all three names in the SAN list and a verify return code of 0. - The client reloads the page, the padlock appears, and the designer notes in a spreadsheet that any future subdomain must be added to the certificate before it goes live.
Quick reference
| Situation | What you see | Fix |
|---|---|---|
| Only www or only bare domain covered | Warning on the other form | Add both names to the certificate |
| Wildcard used for the bare domain | Warning on example.com |
List example.com as well as *.example.com |
| Wildcard used two levels deep | Warning on a.b.example.com |
Add a name or wildcard for that level |
| New subdomain without certificate | Warning only on the new host | Add the name and install |
| DNS points to the wrong server | Certificate for a different site | Correct A and AAAA records, wait for caches |
| Opened by IP address | Mismatch whatever the certificate | Use the public hostname |
| No SNI or no virtual host | Default certificate shown | Configure the host, check the default site |
| Proxy or CDN in front | Name missing on the service | Add the hostname there and check the origin |
Limits and what to watch for
- Do not hide a mismatch by turning off verification. Disabling the name check in a script or app removes protection against connecting to the wrong server.
- A single certificate is not the answer to every name. Large lists of unrelated names on one certificate make renewals harder and expose the names publicly. Group names sensibly.
- Mixed-content warnings are different. A page can load over HTTPS with a perfect certificate and still show warnings because some resources are requested over HTTP. See the guide to mixed content and how to fix it for that separate problem.
- Redirects do not rescue a mismatch. The browser checks the certificate before it follows a redirect, so a redirect cannot hide a bad certificate on the first host.
- Check email and API hostnames. A mail server or API that uses a different hostname needs its own matching certificate.
- Allow time for DNS and caches. After a change, test from several networks and be patient before concluding the fix failed.
- Keep private keys private. Reissuing for new names may involve a new key, and it should never be sent by email or chat.
Summary
A certificate name mismatch means the hostname a visitor used is not listed in the certificate's Subject Alternative Name list, or the server presented the wrong certificate for that name. Read the SAN list, compare each hostname exactly, and remember that wildcards cover only one label and never the bare domain. Check DNS, SNI and any proxy or CDN in front of the site, then reissue the certificate with all required names, install it with the full chain, reload the service and test each hostname from outside.
When you are ready to arrange certificates for your own domains and subdomains, the SSL certificates page shows what is on offer.
Frequently asked questions
What is an SSL certificate name mismatch?
It happens when the hostname you typed in the browser is not listed in the certificate the server presented. Browsers check the Subject Alternative Name list, and if the hostname is not covered, they show a warning such as ERR_CERT_COMMON_NAME_INVALID.
Does a wildcard certificate cover the bare domain and every subdomain?
No. A wildcard such as *.example.com covers one label only, for example www.example.com or shop.example.com. It does not cover the bare example.com, and it does not cover a.b.example.com. The bare domain must be listed separately.
Why do I get the wrong certificate when I open the server by its IP address?
A certificate is issued for names, not for a plain IP address, in most cases. When you connect by IP, the server cannot tell which site you want and may present a default certificate that does not match.
How do I check which names a certificate covers?
Open the certificate details in your browser and read the Subject Alternative Name field, or run openssl s_client piped into openssl x509 with the -ext subjectAltName option, and compare each name with the address you use.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need an SSL certificate?
Pick the certificate type that fits your site and see the price before you check out.
SSL from $14.99
See SSL certificatesKeep reading

SSL Guides
How to Fix NET::ERR_CERT_AUTHORITY_INVALID
The browser does not trust the issuer of the certificate. Causes include self-signed certificates, a missing intermediate, a rewritten connection or an outdated device.
10 min read

SSL Guides
What Is Mixed Content and How Do You Fix It?
A padlock that disappears or a script that never loads is often mixed content. Learn what it is, how to find the offending URLs and how to fix them properly.
10 min read

SSL Guides
How to Fix ERR_CERT_DATE_INVALID
ERR_CERT_DATE_INVALID has two common causes: a wrong clock on the visitor's device, or a certificate that really has expired. Here is how to tell them apart and fix each.
9 min read