Skip to content

The server has a valid certificate. Why does the browser refuse HTTPS?

The Connection Is More Than an IP · Part 3 of 6 · 5 min read

Read the worked explanation ↓

Interview question. A company moves shop.example.com to a new edge. The edge serves HTTPS on the correct IP address, and its certificate has not expired. Yet some customers receive a certificate warning while others connect normally. A teammate says a certificate is either valid or expired and wants to disable verification in the SDK. What would you investigate?

First, I would reject disabling verification. HTTPS authenticates the service the client intended to reach, not merely the host that happened to answer at an IP address. The browser must establish that the certificate's identity matches shop.example.com, that a trusted path exists from the leaf certificate through the issuing authorities, and that relevant certificate and client policies are satisfied. Encryption without authentication can protect a conversation with the wrong server.

The hostname is the reference identity. A DNS answer tells the client where it might connect, but the leaf certificate must still prove an acceptable identity for that name. Modern checks use the Subject Alternative Name extension for DNS identifiers. A certificate valid for www.example.com is not automatically valid for shop.example.com. Wildcard matching is constrained rather than an unlimited suffix match. The IP that DNS returned does not usually need to be listed as the identity when the application connected by hostname.

A certificate chain links the shop.example.com leaf certificate through an intermediate authority to a trusted root, while hostname and policy checks happen at the client.
A certificate chain links the shop.example.com leaf certificate through an intermediate authority to a trusted root, while hostname and policy checks happen at the client.
Think first

One CDN edge fails TLS only for older Android devices while other edges work. The leaf certificate is unexpired and names the right host. Show how you would separate alternate chain building, missing intermediate, SNI, trust-anchor differences and unsupported signature algorithms.

Take a few minutes to form an approach, then compare it with the worked explanation.

Reveal the worked explanation

What a chain establishes

The edge presents a leaf certificate and generally sends the intermediate certificates required to build the chain. The client's trust store holds trusted roots or trust anchors, not a preinstalled copy of every site certificate. A path validation algorithm checks the signatures and relevant constraints along an acceptable path. A root need not be sent as part of the server's chain because the client already obtains its trust decision from its local policy.

The client also examines validity periods, permitted usages and other constraints relevant to the service. Name constraints, key usage, basic constraints and algorithm support can affect whether a plausible-looking chain is acceptable. Revocation and Certificate Transparency are additional policy areas whose exact enforcement differs across clients. It is misleading to describe revocation checks as universally hard-failing or to imply that Certificate Transparency alone establishes trust.

Imagine edge A sends the leaf and intermediate. Edge B sends the same leaf but omits the intermediate. Some clients can discover or cache the missing intermediate, while others fail to build an acceptable chain. The observed split might depend on operating system, trust store, browser behavior or connection history. A newer client may support a chain path that an older device cannot build because its trust anchors differ. So a certificate file that passes inspection on one engineer's laptop is not enough proof for the fleet.

SNI and the hostname you actually requested

A shared HTTPS edge hosts many names on one public IP. During the TLS handshake, a client can send Server Name Indication so the edge knows which certificate and virtual host configuration to use. An outdated client that omits SNI might be given a default certificate for some other domain. That failure can appear only for a subset of devices. It is unrelated to an expired leaf certificate, even though the user-facing warning can sound similar.

A reverse proxy can also choose the wrong certificate because of a deployment mistake or inconsistent edge configuration. I would test each public IP with the same hostname and the appropriate SNI, collect the served certificate chain, and compare the results across edges. Connecting directly to an IP without telling the test client the original hostname may reproduce a different handshake from the one real customers perform.

During a migration, old and new endpoints need valid certificate coverage for the same hostname for as long as both receive traffic. Terminating the old TLS listener before old DNS answers or connections disappear is another way to produce partial HTTPS failures. Keeping both endpoints available during migration is just as important for cryptographic identity as for application routing.

A diagnosis that preserves security

I would classify the failure by exact verification error: hostname mismatch, unknown issuer, incomplete chain, expired or not-yet-valid certificate, prohibited usage, unsupported algorithm, or a client-specific trust policy. Then I would correlate it with edge IP, client platform, SNI presence, issuance chain and deployment version. Local and remote clocks matter for validity periods, but a synchronized clock will not fix an untrusted issuer.

To validate an endpoint, I would use a TLS client that checks the requested hostname and trust path, not merely one that prints the certificate. For operational checks, openssl s_client can display peer chains with explicit server name settings, but its exit and verification behavior depend on flags and environment. Browser and mobile-client reproduction still matters. I would deploy a corrected full chain and test on representative trust stores before making certificate rotation the new incident.

The interviewer may ask whether a private enterprise root helps. It can, in an explicitly managed trust environment. It is not a fix for arbitrary public browsers, and it expands the trust and key-management responsibilities. The credible design includes certificate automation, renewal overlap, monitoring of expirations and chains, and deployment consistency across edge locations.

A browser's green lock is therefore the result of several checks tied to a name, not simply proof that a port speaks encryption. Once identity is correct, the next question becomes performance: how many network round trips does TLS need before an application can send its request, and which of those can safely be skipped?

Go deeper

RFC 5280 specifies certificate path validation structures and constraints. RFC 9525 updates service-identity rules for TLS, with DNS-ID identities expressed through subjectAltName. Real browser root programs and Certificate Transparency policies add rules beyond generic PKIX validation, so an accepted chain can vary across client types. SNI tells the server which name the client wants to contact, while ALPN negotiates an application protocol such as h2 or http/1.1. Neither SNI nor a DNS address alone replaces the certificate's identity and trust validation.

Check your reasoning

  • Explain DNS SAN hostname matching and reference identity.
  • Establish a trusted leaf, intermediate and root chain under client policy.
  • Discuss expirations, constraints, usages and client trust-store differences.
  • Relate SNI to virtual-host certificate selection.
  • Diagnose edges and client populations without disabling verification.

Common mistake: An unexpired certificate signed by any CA is valid for all names hosted on the same address.

Only some clients reject an unexpired certificate at a new HTTPS edge. Which diagnosis preserves authentication?

Read the answer explanation

Compare hostname, served chain, SNI and client trust store by affected cohort — Certificate identity and trust-chain validation are client and hostname specific.

Apply it elsewhere

An internal service mesh begins using private CAs for mTLS. A pod connects using a service DNS name but receives a certificate with a different workload identity. Decide which reference identity and trust policy should govern the check and why turning off name validation is not acceptable.

Compare your approach

Establish reference identity and SAN matching, chain construction, trust anchors, validity/usage policies, SNI behavior and device-specific diagnosis without weakening verification.

One more constraint

If a certificate is unexpired and signed by an intermediate, is it guaranteed to be accepted by a browser connecting to any hostname at the same IP address?

Quick revision

A browser trusts an HTTPS endpoint when it can validate an acceptable certificate chain to a trusted anchor and verify that the leaf certificate identifies the requested service name under applicable policy. Valid dates alone are insufficient. Wrong SAN, missing intermediate, SNI mismatch or different client trust stores can explain partial failures. The old and new edges both need valid identity coverage during migration. Never disable verification to make the warning disappear.

References