Hostname errors · Practical guide
How to troubleshoot an SSL certificate name mismatch
A name mismatch means the certificate cannot establish the identity of the requested hostname. Preserve that exact hostname while investigating. A certificate can be valid for another name and still be wrong for this connection; replacing it only helps if coverage is actually the problem.
Find the missing www name before changing redirects
Suppose example.com works, but https://www.example.com produces a certificate warning. The certificate served to www contains only example.com. These are separate identities even when they point to the same server. A redirect from www to the apex cannot repair the TLS connection that must happen first.
Check the certificate actually served for www, rather than a certificate listed in the hosting dashboard. If its SANs omit www, obtain coverage for both names and attach the certificate to the correct endpoint. If the correct certificate already exists, investigate its assignment before requesting another one.
Requested URL: https://www.example.com/docs
Served SAN: DNS:example.com
Result: www.example.com is not covered
Required coverage for these two public names:
DNS:example.com, DNS:www.example.com - Record the failing hostname, connected IP, verification result and served certificate SANs.
- Determine whether coverage is missing or the endpoint selected the wrong certificate.
- Correct that endpoint and verify both hostnames before testing the redirect between them.
Compare the requested name with the SAN entries
Modern DNS hostname verification uses the certificate’s subject alternative names, or SANs. A control-panel label, organization name or legacy Common Name is not a substitute for the required DNS SAN. Check the certificate received on this connection, including any wildcard’s exact scope.
A wildcard matches one complete leftmost label. It does not cover the apex or any number of nested subdomains. DNS wildcard records and certificate wildcards are separate settings: making a hostname resolve does not add it to the certificate.
| Certificate DNS SAN | Covered example | Not covered by this entry |
|---|---|---|
| example.com | example.com | www.example.com |
| *.example.com | www.example.com or shop.example.com | example.com or api.shop.example.com |
| *.shop.example.com | api.shop.example.com | shop.example.com |
Reference: RFC 9525: TLS service identity and wildcard matching
Check DNS, SNI and the selected virtual host
Compare current A and AAAA records with the intended deployment. IPv4 might reach the new server while IPv6 still reaches an older listener. Record the IP reached by each failing test, then inspect its virtual host, certificate assignment and recent configuration changes. At a CDN, distinguish public edge addresses from the separately configured origin.
SNI supplies the requested hostname during the TLS handshake so a shared listener can select its certificate. Testing https://192.0.2.10/ changes that identity. Adding only a Host header does not restore the original TLS name. Instead, keep the hostname in the URL and use curl --resolve to target a particular address.
The example uses a documentation-only IP: replace it with an endpoint you administer. It connects directly, retains hostname verification and stops after fifteen seconds. Test each relevant address separately; for IPv6, bracket the address inside the --resolve value. It deliberately does not follow redirects.
curl -q -v --max-time 15 --noproxy '*' \
--resolve 'www.example.com:443:192.0.2.10' \
'https://www.example.com/' -o /dev/null Reference: curl: target an address with --resolve
Verify TLS before checking the HTTPS redirect
Every supported HTTPS alias needs its own matching certificate coverage, including an alias whose only job is redirecting. Repair the original connection first; a successful check of the final destination says nothing about the source hostname’s certificate.
CheckSSL uses the supplied hostname on port 443 with SNI and hostname verification. It reports the connection reached during that scan, not every IPv4, IPv6 or regional endpoint. If verification fails, a diagnostic handshake may still expose SANs and dates. Those details do not turn a failed or unknown hostname result into a pass.
Reference: curl: certificate and hostname verification
Repair the responsible endpoint and retain the failing case
Use the evidence to choose the change: correct stale DNS, select the intended virtual host, deploy the matching certificate and chain, or add a missing SAN through reissuance. Reissuing a certificate cannot repair traffic still reaching the wrong server. Keep certificate verification enabled throughout the completion check.
- Retest the original hostname and every supported apex, www and application alias.
- Compare IPv4 and IPv6 routes where both are published, recording the address and certificate returned.
- Confirm trust, hostname and validity pass, then check the original HTTPS redirect and destination content.
- Verify renewal deploys to the corrected listener and retain the failing hostname in ongoing monitoring.
Reference: Nginx: name-based HTTPS configuration
Keep reading
Related guides
How to check SSL certificate expiry and renewal
Compare the served certificate with a renewed file, interpret expiry warnings and verify deployment with CheckSSL and OpenSSL 3.
Read guide Certificate trustSSL certificate chain errors: what to investigate
Inspect the served chain, verify public certificates against trusted roots and fix deployment errors without weakening certificate checks.
Read guide TLS versionsHow to check supported TLS versions
Interpret CheckSSL protocol probes, test TLS 1.2 and TLS 1.3 with OpenSSL 3, and distinguish server rejection from an inconclusive client failure.
Read guide CDN certificatesHow to check SSL certificates behind a CDN
Separate edge and origin TLS checks, target an origin with the correct hostname and trust store, and verify certificate fixes behind a CDN.
Read guide Certificate issuanceCAA records and certificate issuance: how to fix errors
Find the relevant CAA policy, distinguish DNS failures from missing records and authorize the intended certificate provider without breaking renewal.
Read guideTLS certificate reference: trust, names, expiry and protocol checks
Interpret certificate and TLS findings, including unknown verification, received chains, revocation and protocol probes.
Open reference