Definition

Send the intended SNI hostname and explicitly verify that same name. When comparing your own addresses, hold the SNI and verification name constant and change only the connection address. Record which certificate each address serves.

Separate the connection address from the hostname

SNI tells the server which name the client is trying to reach. The verifier then independently checks whether the selected certificate is valid for the intended name. The HTTP Host header arrives after TLS setup, so editing that header alone cannot change which certificate was served in the handshake.

On an endpoint you operate, run openssl s_client -connect tls.example.com:443 -servername tls.example.com -verify_hostname tls.example.com -verify_return_error -showcerts </dev/null. Use the actual host, port and trust configuration. If needed, perform a separate capture with -showcerts and without -verify_return_error to inspect a failing peer's presented certificate list. Treat capture as observation.

Official sourcesRFC 6066, Server Name Indication ↗OpenSSL s_client documentation ↗

Compare sample results on your own listeners

Observed resultNext check
Correct cert with the hostname, different cert at a direct IPKeep -servername and -verify_hostname set to the intended hostname in the direct-address test. Check which virtual host handled the connection.
One authorized edge presents a different leaf with the same SNIReview target address, certificate attachment and rollout status at that termination point.
All addresses consistently present a certificate for a different nameCheck the listener's certificate binding and the leaf's subject alternative names.
Name is covered and trust verification failsInspect the presented intermediates, dates and the trust policy of the affected client.

Retest after correcting the certificate binding

Keep the exact connection address, SNI value, verification name, observed leaf fingerprint and outcome. For a targeted check, replace only -connect tls.example.com:443 with the authorized address and port, for example -connect 192.0.2.10:443. Keep the hostname in the two name options.

If a CDN or gateway terminates TLS before forwarding to an origin, record each relevant TLS leg separately. Compare the expected fingerprint and hostname result after rollout, and rerun the client path that reported the error.

Frequently asked questions

Can the same IP address serve different TLS certificates?

Yes. A shared listener can select different certificates based on SNI and other negotiated parameters. Compare the exact hostname and client profile.

Does -servername validate the certificate hostname?

It sends the requested name to the server. Use -verify_hostname with the intended name and check the verification result.

Will changing the HTTP Host header fix a certificate mismatch?

Correct the TLS listener or client name first. The server selects its TLS certificate before processing the HTTP request.