Skip to content

Field Notes

How to Diagnose SSL Hostname and Certificate-Chain Errors

Learn how to diagnose SSL hostname mismatches, incomplete certificate chains, wrong CDN certificates, wildcard coverage, and TLS trust errors.

EmailLinkedIn
TLS certificate diagnosis pathRequested hostnamePublic TLS endpointPresentedcertificateSAN coverageChain trustClient result
TLS certificate diagnosis path
Check Question answered Evidence
Hostname Is this exact name covered? SAN list on the presented certificate
Chain Can clients reach a trusted root? Leaf and intermediate certificates
Endpoint Which layer serves TLS? CDN, listener or virtual-host binding
On this page

Environment covered: Public HTTPS endpoints across CDN, load balancer, NGINX, Apache and managed hosting layers

A certificate check needs four separate answers: which endpoint served the certificate, which hostname it covers, whether it is currently valid and whether the client can build a trusted chain. Renewal success answers only part of that diagnosis.

Start with the failing URL and the client’s actual connection. Inspecting the newest certificate file on an origin can be irrelevant when a CDN terminates the public TLS session.

The renewal, CDN binding and client disagreements below are hypothetical diagnostic examples. Hostnames and sample output are synthetic.

Locate the TLS endpoint before inspecting renewal

Consider a public application behind a CDN. The origin’s certificate is renewed, but the public hostname terminates TLS at the CDN. A browser continues seeing the certificate attached to that public endpoint.

The initial renewal was not necessarily broken. It repaired a different connection. There may be two TLS sessions: browser to edge, and edge to origin. Each has its own expected hostname, certificate and trust requirements.

Write down the endpoint the client contacts before inspecting another renewal log. Start with DNS and the hostname in the failing URL. Include apex, www and any alternate entry point a redirect expects users to visit.

dig +short A www.example.test
dig +short AAAA www.example.test

The domain is reserved for examples. In a real investigation, run the check only for the approved hostname. An old AAAA path can send one client to a different endpoint from the A record used by another. DNS agreement is useful, but it is not certificate validation.

Capture the handshake for the requested server name

An operator may propose redirecting the broken hostname to a working one. That can help routing only after the client completes the initial TLS connection. If the first hostname is not covered, the browser can refuse before it ever reads the redirect.

Inspect the certificate presented for the requested name, including SNI. Many TLS listeners select a certificate based on that name, so connecting to an address without SNI can show a default certificate that the real browser never sees.

openssl s_client \
  -connect www.example.test:443 \
  -servername www.example.test \
  -verify_hostname www.example.test \
  -verify_return_error \
  -showcerts </dev/null

This is a diagnostic example, not a command against a live fixture. The flags separate SNI selection from hostname verification, and make a verification failure stop the handshake test. An unqualified s_client connection can continue after verification errors; “connected” is not a complete trust result.

Do not add curl’s insecure option to make the result green. That would remove precisely the trust and hostname checks the investigation needs.

Check hostname coverage independently of dates

In the fictional failure, the public endpoint presents a certificate whose issuer and dates look plausible. Its Subject Alternative Name list does not cover the requested name.

Illustrative SAN set
DNS: example.com
DNS: *.example.com

That set can cover the apex explicitly and a single label such as www.example.com through the wildcard. The wildcard alone does not cover the apex, and it does not normally cover deep.api.example.com.

Hostname coverage is a separate test from validity dates. Modern clients rely on SAN identity rather than a familiar-looking subject common name. Read the names in the certificate actually presented by the public connection, not only in a certificate file saved on another server.

The repair in this example is to attach an appropriate certificate to the correct public listener or distribution and let that change reach the serving endpoint. Issuing a certificate without binding it to that endpoint leaves the original failure in place.

Validate the presented chain with the intended trust store

Now suppose the hostname and dates are correct, one browser works, and a command-line client still cannot build a trusted chain. Treat the disagreement as evidence, not as a reason to disable verification for the failing client.

A browser may have cached or retrieved an intermediate that another client lacks. A server sending an incomplete bundle can therefore appear healthy from one workstation. Inspect the leaf and required intermediate certificates sent during the handshake, then validate against the intended client trust store.

The server normally supplies the leaf and intermediates needed for path building; sending a root certificate does not make an untrusted root trusted. For an intentionally private CA, distribute trust through an approved client configuration. For a public service, fix the server’s public chain instead of asking every visitor to install an exception.

# Inspect a saved public certificate from an approved capture.
openssl x509 -in leaf.pem -noout \
  -subject -issuer -dates -ext subjectAltName

This checks the file’s properties, not whether the network endpoint serves that file. Keep the file inspection and live handshake as two distinct pieces of evidence.

When only some clients fail

A certificate whose validity starts in the future may indicate a client-clock problem or an incorrect certificate, while an expired certificate points to a different renewal or deployment failure. Verify the client’s time and both date bounds before changing the server.

If only one network fails, consider different DNS paths, IPv6 preference, TLS interception or trust-store differences. A corporate proxy can legitimately present a different issuer to managed clients; publishing that intercepted chain as evidence of the public endpoint would be misleading.

A CDN can also validate its origin independently of the browser’s connection. The public certificate may be correct while the edge-to-origin handshake fails. Inspect that connection through the approved origin hostname and access path, preserving the intended SNI and certificate checks. Do not make a private origin public simply to obtain a convenient test URL.

Verify the corrected binding and monitor the served certificate

After the binding or bundle change, test the original failing hostname first. Then test apex, www, relevant aliases and any A/AAAA paths still intentionally published. Check the complete routing chain and canonical destination after TLS succeeds.

Keep evidence of the presented certificate, hostname check, chain result and deployment state. A renewal monitor should distinguish a certificate file’s expiry from the certificate actually served to clients. It should also be clear which team owns the edge certificate and which owns the origin certificate.

The SSL Certificate Checker provides a point-in-time public view of supported TLS evidence. Use it to cross-check the endpoint, not to replace a client-specific investigation or claim continuous coverage.

For ongoing monitoring, probe the public handshake for each supported entry name. Check the origin session separately where applicable, using its approved hostname and access path. This catches a binding or intermediate-bundle regression that an expiry check on a local certificate file would miss.

Sources and further investigation

References support the protocol and product behavior discussed here; they are not evidence that the illustrative scenario occurred.

Continue the investigation

Need a second set of eyes?

Working through a similar production issue?

Discuss the technical context