troubleshooting 2026-12-02 ⏱ 3 min read

Fix SSL Certificate Mismatch

Fix SSL Certificate Mismatch
Quick Answer: A certificate mismatch means either the domain you visit is not listed in the certificate (browser error such as ERR_CERT_COMMON_NAME_INVALID), or the private key installed on the server does not belong to the certificate (server fails to start). Check which one you have, then reissue or reinstall.

SSL certificate mismatch: the name mismatch

The browser shows ERR_CERT_COMMON_NAME_INVALID, "Your connection is not private" or a "doesn't match" message. The certificate is valid but not for this hostname.

See which names the certificate covers:

openssl s_client -connect example.com:443 -servername example.com < /dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName

Or run the SSL Checker. Compare the names listed with the one you visit.

You visitCertificate coversResult
www.example.comexample.com onlyMismatch
example.comwww.example.com onlyMismatch
shop.example.comexample.com, www.example.comMismatch
shop.example.com*.example.comMatch, wildcard covers one level
a.b.example.com*.example.comMismatch, wildcard covers one level only

Common causes

  • The certificate was issued without the www name or a subdomain.
  • The server returns a default certificate because the virtual host for this name has no certificate or no SNI match.
  • A CDN or shared host serves another customer's certificate.
  • DNS points to the wrong server.

Fixes

  1. Reissue the certificate with every name you use. You can do this free on TryFreeSSL.com.
  2. Make sure the right server_name or ServerName is in the matching HTTPS virtual host.
  3. Verify DNS with the DNS Lookup.

SSL certificate mismatch: key and certificate

The server will not start or reload and logs something like "key values mismatch". Compare the public keys:

openssl x509 -in certificate.crt -noout -pubkey | openssl sha256
openssl pkey -in private.key -pubout | openssl sha256

If the two hashes differ, the files are from different key pairs. Typical reasons are a renewal that created a new key while the old key stayed in place, or files copied from two different folders. Install the key that was generated with the CSR for this certificate, or reissue with a new CSR and keep that key. More in the guide Check If a Certificate Matches Its Private Key.

Check your redirect and canonical host

Choose one canonical host and redirect the other to it. Both hostnames still need to be covered by the certificate, otherwise the redirect itself triggers the warning first. Test with the HTTPS Redirect tool.

Quick decision guide

SymptomDo this
Browser warns, server runsCheck names in the certificate
Server will not startCompare certificate and key
Warning only on one subdomainAdd it to the certificate or use a wildcard
Wrong site's certificate appearsFix the virtual host or SNI configuration

Related problems

An incomplete chain gives a different error, see the chain checker guide. If the padlock is still missing after the fix, read why a site says Not Secure after installing SSL.

Related reading: Fix 'SSL Certificate Not Trusted', installation failed errors and the wildcard certificate.

Frequently Asked Questions

Does a wildcard cover the bare domain?

Not on its own. List example.com as well as *.example.com in the request.

Can I ignore the warning?

Do not train visitors to click through it. Fix the certificate.

Why do I see it only on some networks?

Some networks intercept traffic or resolve to a different server. Compare the certificate from two networks.

Is the Common Name still used?

Modern browsers check the Subject Alternative Name list, so make sure the names are there.

🔒 Test Your Website SSL Certificate Now
Run Free SSL Check →

✅ Post-Installation Verification & SEO Checklist

After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:

  • Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
  • Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
  • Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
  • Confirm both root and www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant