Skip to content
WebsiteHosting.com

troubleshooting HTTP, TLS & web servers

TLS certificate hostname mismatch

A TLS hostname mismatch occurs when the requested reference identity does not match a supported name in the certificate presented by the server.

Sources checked · P0045

What it means

A TLS certificate hostname mismatch occurs when the requested reference identity, usually the hostname in an HTTPS URL, does not match an appropriate identity in the certificate presented for that connection. The requested host is compared with DNS-ID entries in the Subject Alternative Name (SAN) extension under the applicable matching rules. IP literals require an appropriate IP address identity rather than just a DNS name that resolves to the same address. A redirect cannot repair a handshake already rejected for the wrong name.

Try it

Simulation — compare reference identity with SAN. Select www.example.com with a matching exact SAN or *.example.com and inspect one-label wildcard behavior. Try a.b.example.com: it does not match the single-label wildcard in this fixture. Choose 192.0.2.10 and a DNS-only SAN, then inspect IP-ID mismatch. Select an expired chain or a redirect-only plan to understand why other validation steps and the order of HTTPS/redirect matter. Reset clears the diagnostic path.

Certificate hostname mismatch diagnosis

Compare the requested hostname to SAN identifiers before choosing a safe correction.

Simulation
Requested identity matches SAN

The presented SAN www.example.com matches the reference www.example.com. Chain/time checks are independent and are not proof of full TLS validity. Plan not applied

Certificate hostname mismatch diagnosis: evaluated fixture values
ObservationModel value
Referencewww.example.com
Presented SANwww.example.com
Configured SANwww.example.com
Endpoint selectionselected
Name match?true
Path/time fixturevalid-chain
Remediation assessmentPlan not applied
Certificate hostname mismatch diagnosis: local scenario parameters

Local, bounded educational fixture. No DNS, mail, certificate, network, socket or external request is performed.

About this model

Restricted ASCII DNS-ID and IP-ID fixtures only, not a general RFC 9525 implementation. If the wrong virtual host is selected, its synthetic fallback certificate (fallback.example.net) is presented instead of the configured intended SAN. A redirect happens after HTTPS identity checks; never bypass TLS validation.

See the article’s protocol sources and model limits. The scene does not alter a real system.

How the mechanism works

Clients start with a reference service identity and compare it against relevant identifiers presented by the selected endpoint. Servers that host multiple sites can present different certificates depending on endpoint configuration and SNI. A certificate valid for example.com does not automatically cover www.example.com, and DNS resolution to an IP does not turn a DNS-ID into an IP-ID. Wildcards, where applicable, are restricted; they must not be interpreted as matching arbitrary depths or arbitrary identity types. Matching a name does not prove the trust chain or validity period passed.

For an HTTPS redirect to happen, the client ordinarily must first establish a secure connection to the origin responding with the redirect. If its certificate name is wrong, redirect configuration cannot rescue the failed TLS identity step. The safe fix is to serve a certificate with the correct authorized SAN from the intended endpoint and then verify deployment and chain.

Primary protocol documentation provides the underlying rules; the interactive state is only a synthetic illustration.

In practice

In an authorized staging environment, record the exact requested URL authority and endpoint selected, then examine presented SANs and trust validation using verification enabled. Compare SNI, routing and certificate deployment configurations without copying private keys. Stop if the endpoint is unknown, the certificate is expired/untrusted or a suggested workaround disables verification. Prepare and deploy the correct certificate and verify the original URL; retain the prior known-good certificate and a controlled rollback route.

Limits and common mistakes

The scene restricts identity checks to a small set of ASCII DNS names, IP literals and a simple wildcard. It does not implement IDNA, internationalized names, all RFC 9525 application identifier types or complete certificate-path validation. It cannot diagnose every browser warning or scan real certificates.

Key takeaways

Use the exact requested reference identity and the actual SANs of the certificate served at that endpoint. A single-label wildcard is not an unrestricted suffix match; an IP literal needs the appropriate IP identifier. Fix certificate/SNI/endpoint selection with verification enabled—an HTTPS redirect arrives too late to repair a TLS name mismatch.

Frequently asked questions

Editorial questions, answered from the sources listed for this article.

Can a 301 redirect fix a wrong TLS certificate name?

Not by itself. The browser must authenticate the original HTTPS endpoint before it can receive and follow that redirect.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. Service Identity in TLS

    Reference versus presented service identity and wildcard matching (§6). Reference/presented identity and wildcard matching. Official info/search metadata verified; directHTML attempt returned429, do not claim full section reread.

    Checked .

  2. Internet X.509 Public Key Infrastructure Certificate and CRL Profile

    Certificate and certification path validation (§§4,6). Chain/path validation concepts; toy example is not a full PKIX implementation.

    Checked .