The TLS extension server name indication (SNI) carries the requested hostname in ClientHello. It enables certificate selection for websites sharing an IP address. RFC 6066 defines SNI.
For troubleshooting, check three things separately: which hostname the client sends, which certificate the server returns, and whether ECH protects the inner ClientHello.
Key Facts
- Server name indication carries the requested hostname in the TLS ClientHello.
- SNI enables certificate selection for websites sharing an IP address.
- SNI does not replace certificate identity and trust validation.
- TLS 1.3 alone does not encrypt the initial ClientHello.
- Ordinary HTTP CONNECT tunneling preserves the destination TLS handshake.
- JA4’s d/i field records SNI presence or absence, not the hostname.
- An ECH DNS advertisement does not prove successful ECH acceptance.
What is SNI (server name indication)?
Server name indication identifies the intended website during TLS setup, before the server sends its certificate. It gives a shared endpoint the hostname needed to select a virtual host.
Example: shop.example.com and support.example.com resolve to the same address. Different SNI values allow that endpoint to select different certificates and TLS configurations.
SNI is a selection signal, not proof of identity. The client must still authenticate the server, and the server should not treat a client-chosen name as authorization. The SNI HostName format carries DNS hostnames; literal IPv4 and IPv6 addresses are not permitted in that field. See the server_name extension specification.

How TLS SNI works: how does server name indication select a certificate?
The server reads SNI from ClientHello and uses it to select a certificate and TLS configuration. The client then validates the selected certificate against its intended service identity.
| Stage | Information | Purpose |
|---|---|---|
| ClientHello | Requested hostname and TLS parameters | Identify the virtual host and negotiate TLS |
| Server authentication | Selected certificate chain and handshake authentication | Present and prove the server identity |
| Client validation | Expected hostname, trust chain, and validity | Decide whether to trust the connection |
| HTTP exchange | Request authority, path, headers, and content | Request the application resource |
This is the usual certificate-authenticated connection sequence; resumed sessions can differ. The TLS 1.3 protocol overview explains the handshake, and RFC 9525 defines service identity checks.
Changing an HTTP Host header cannot repair an earlier certificate-selection failure. Keep the URL hostname, intended TLS name, and HTTP authority consistent unless you are deliberately diagnosing a routing difference.
How is SNI different from DNS and certificate SANs?
DNS locates an endpoint, SNI requests a hostname during TLS setup, and certificate Subject Alternative Names (SANs) identify the names a certificate covers. They answer different questions.
| Mechanism | Question answered | Example |
|---|---|---|
| DNS | Where should the client connect? | A hostname resolves to an endpoint address |
| SNI | Which TLS virtual host does the client want? | ClientHello requests shop.example.com |
| Certificate SAN | Which identities does the certificate cover? | A DNS SAN contains shop.example.com |
A DNS alias does not automatically make the alias target’s certificate valid for the original URL. If shop.example.com points to hosting.example.net, the client still needs to authenticate shop.example.com. Changing the destination IP does not change a certificate’s SANs. However, correcting the destination can resolve a mismatch if the new endpoint presents a certificate that covers the requested hostname. See service identity verification rules.
For troubleshooting, record these values separately: the requested hostname, resolved address, transmitted SNI, and returned certificate. Combining them into a single ‘domain problem’ hides which stage failed.
Does HTTPS hide the hostname?
HTTPS encrypts HTTP content, including paths and query strings, but ordinary SNI can expose the hostname. TLS 1.3 alone leaves the initial ClientHello visible.
An observer who can inspect that handshake can read plaintext SNI without decrypting the HTTP exchange. TLS 1.3 encrypts later handshake messages, including the certificate, as specified in RFC 8446.
Visibility depends on where the observer sits. An enclosing encrypted tunnel can conceal the destination handshake on one network segment, while leaving it observable after the tunnel exits. Destination IP addresses and traffic patterns can also reveal clues.
Encrypted DNS protects a different exchange. It does not independently encrypt SNI in the subsequent TLS connection. Read the DNS over HTTPS explanation when separating DNS privacy from TLS hostname privacy.
SNI and proxies: CONNECT, routing, and termination
Ordinary CONNECT tunneling forwards the client’s TLS handshake to the destination. Changing the source IP alone does not replace that handshake’s fingerprint.
Distinguish TLS to the proxy from TLS through the tunnel. With an HTTPS proxy, an outer TLS connection authenticates the proxy. After CONNECT succeeds, a separate destination TLS connection runs inside it. The proxy still receives the CONNECT destination. See curl’s proxy documentation and HTTP CONNECT semantics.
With an unencrypted HTTP proxy connection, local observers can inspect CONNECT and ordinary destination SNI. Encryption to the proxy hides those exchanges on that segment, but does not automatically hide the destination handshake on the proxy’s outbound connection.
SOCKS5 similarly communicates a destination address or domain to a proxy. Its base protocol does not itself establish TLS encryption around the transport. See RFC 1928, our SOCKS versus HTTP proxy comparison, and the SSH SOCKS proxy guide for a separate tunneling approach.
SNI-based routing: A router can inspect a visible ClientHello and forward the connection to a matching backend without terminating TLS. The NGINX ssl_preread documentation illustrates this design. Example: route shop.example.com to a commerce backend and support.example.com to a support backend.
Termination and re-origination: A TLS-terminating intermediary accepts one TLS connection and creates another upstream. The destination then observes the intermediary’s ClientHello. An authorized inspection proxy also needs the client to trust its interception certificates; mitmproxy’s architecture documentation explains that arrangement.
Decision matrix:
- Use CONNECT tunneling when you need proxy egress while retaining the client’s destination TLS connection. Avoid CONNECT tunneling when you expect it alone to conceal the destination from the proxy.
- Use SNI-based routing when a visible hostname can select a backend without TLS termination. Avoid SNI-based routing when the decision requires an ECH-protected inner hostname unavailable to the router.
- Use TLS termination when an authorized intermediary must process decrypted application traffic. Avoid TLS termination when your design requires a single TLS connection between client and origin.
How SNI relates to JA3 and JA4 fingerprinting
SNI identifies the requested hostname; JA3 and JA4 summarize characteristics of a TLS handshake. A hostname and a handshake fingerprint are different signals.
Salesforce’s JA3 specification builds a fingerprint from the ClientHello version, cipher suites, extension identifiers, supported groups, and point formats. The SNI extension identifier can appear in its extension list, but the hostname string is not a JA3 input. JA3 also excludes GREASE values.
FoxIO’s JA4 specification uses d when the SNI extension is present and i when it is absent. That field does not contain the hostname. JA4 also sorts certain inputs and excludes SNI and ALPN identifiers from its extension hash component, while representing their presence or information elsewhere.
The practical consequence follows from tunneling semantics: forwarding unchanged ClientHello bytes preserves the fingerprint inputs at the destination. Termination creates a new handshake. Client configuration, library changes, or resumption can also change inputs, so an apparent fingerprint difference needs connection-level evidence.
For related context, see our TLS fingerprinting and client configuration article. A matching fingerprint is not proof of client identity or authorization.
ECH versus SNI and ESNI
ECH encrypts the inner ClientHello, including its SNI. A DNS advertisement alone does not establish successful ECH acceptance.
RFC 9849, published in March 2026, standardizes ECH. A visible outer ClientHello remains, and ECH does not conceal destination IP addresses or eliminate traffic-analysis clues.
ESNI was the earlier approach focused on the server-name extension. ECH expands protection to the inner ClientHello rather than just that name. Cloudflare’s ‘Good-bye ESNI, hello ECH!’ article explains why ECH succeeded ESNI. See also the Cloudflare ECH documentation.
Firefox enables ECH by default from version 119, but enterprise policies, parental controls, or detected trusted interception proxies can disable it, as described in Mozilla’s ECH support documentation. Verify ECH use on the connection being tested.
Operationally, verify the client’s configuration, obtain usable server configuration, and inspect the connection result. Do not interpret the mere presence of an ECH extension as acceptance: clients can send a GREASE ECH extension. The acceptance procedure is defined in RFC 9849, section 6.1.4.
How to check SNI and test ECH acceptance
Test certificate selection and ECH acceptance separately. A successful HTTPS request establishes neither that your intended SNI was sent nor that ECH protected it.
Example: Inspect a certificate-authenticated connection with explicit SNI and hostname verification:
openssl s_client -connect example.com:443 \
-servername example.com -verify_hostname example.com \
-verify_return_error -brief
For certificate comparison, replace -brief with -showcerts and save the output. Use the same numeric IP address in -connect for every comparison. To test without SNI, replace -servername example.com with -noservername; keep hostname verification enabled.
The OpenSSL s_client documentation distinguishes setting SNI from checking the hostname. The verification-error option makes certificate verification failures abort instead of merely displaying them. A usable local trust store is also necessary.
To isolate virtual-host selection on infrastructure you control, keep the address in -connect fixed while changing -servername. Keep -verify_hostname set to the identity you actually intend to authenticate. Record the selected certificate and validation result for each connection.
For ECH, follow these checks:
- Record the client version, TLS backend, DNS mode, hostname, and proxy path.
- Inspect the hostname’s HTTPS DNS records for usable ECH configuration. Treat this as configuration discovery.
- Make a fresh connection using an ECH-capable client and configuration.
- Check explicit acceptance diagnostics or corresponding server telemetry, including any retry or rejection.
- Keep certificate verification enabled and save the connection outcome separately from the ECH outcome.
For curl, --ech hard requires an ECH attempt and fails when that is impossible; --ech true can proceed when ECH is not attempted. ECH requires a compatible build and TLS backend, with configuration obtained through DoH or an explicit ECHConfigList. curl currently documents its ECH support as experimental and advises against production use. Use an ECH-enabled build for the diagnostic tests described here. Consult the documented ECH options and curl ECH implementation notes before interpreting results.
A DNS-only survey can describe advertised configuration, but cannot count accepted ECH connections. Likewise, one successful connection says nothing about every hostname or network path.
How do you troubleshoot SNI in IIS, AWS, and reverse proxies?
Use the 4-step SNI diagnosis check to separate endpoint routing, hostname selection, and certificate validation. Apply it independently to every TLS connection when an intermediary terminates TLS.
Step 1: Destination IP. Confirm the client reaches the intended endpoint. Check DNS results, proxy destinations, and load-balancer placement.
Step 2: Sent hostname. Capture the connection where its ClientHello is visible. In Wireshark, filter on tls.handshake.type == 1 and inspect tls.handshake.extensions_server_name; see the Wireshark TLS fields. With ECH, the visible outer SNI does not reveal the protected inner hostname, as described in RFC 9849. For a terminating reverse proxy, inspect the upstream handshake as well as the incoming one.
Step 3: Selected certificate. Compare the returned certificate with the intended virtual host. A default certificate can indicate missing SNI or an unmatched name.
Step 4: Certificate validation. Check SAN coverage, validity dates, and the trust chain. Disabling verification conceals the failure and introduces interception risk.
IIS: Check the HTTPS binding’s hostname, port, certificate, and SNI setting. Microsoft’s binding documentation defines the SNI flag in sslFlags.
AWS Application Load Balancer: Inspect both the listener’s certificate list and its default certificate. AWS documents default-certificate use for absent SNI or no matching certificate; see HTTPS listener certificate selection.
NGINX reverse proxy: For HTTPS upstreams, NGINX defaults to proxy_ssl_server_name off, proxy_ssl_verify off, and proxy_ssl_name $proxy_host. Enable upstream SNI and certificate verification, configure trusted CA certificates with proxy_ssl_trusted_certificate, and set proxy_ssl_name to the intended upstream DNS identity when $proxy_host does not match it. Incoming SNI does not automatically establish the correct upstream identity. See the upstream TLS directives.
These implementation references were checked on November 10, 2026. Keep logs from each connection boundary together; our debugging tools and techniques guide offers additional workflow context.
Frequently Asked Questions
Frequently Asked Questions
Is SNI the same as a DNS name server?
No. A DNS name server answers DNS queries, while SNI is information sent during TLS connection setup. A client can connect to a known address and still send a hostname through SNI.
Does SNI replace certificate validation?
No. SNI helps the endpoint choose a certificate, but the client must determine whether that certificate authenticates the intended service. Receiving the expected certificate does not justify skipping trust or validity checks.
Can changing the HTTP Host header fix a wrong certificate?
No. In the usual HTTPS connection sequence, certificate selection occurs before the application sends its HTTP request. Diagnose the TLS hostname and endpoint configuration first.
Does encrypted DNS hide SNI?
No. Protecting the DNS lookup does not encrypt a separate ClientHello. Assess DNS transport, TLS handshake protection, and any enclosing tunnel independently.
Does an ech parameter in an HTTPS or SVCB DNS record guarantee hostname privacy?
No. The parameter advertises ECH configuration; it does not prove that a connection used ECH successfully. See RFC 9848’s ech parameter definition. Establish acceptance from the actual connection, and remember that IP addresses and other destination clues remain.
Can a proxy operator know the destination despite ECH?
Yes. A CONNECT request can disclose the destination hostname and port separately from the TLS handshake. ECH protection does not remove information already communicated to the proxy.
Does rotating a proxy IP change JA3 or JA4?
An IP change alone does not change the ClientHello inputs used by these fingerprints. A new TLS client configuration or a terminating intermediary can change those inputs. Compare the actual handshakes before attributing a difference to proxy rotation.
Keep egress and TLS expectations clear
If your application needs proxy egress, explore DataImpulse residential proxies, our proxy product. Keep certificate validation enabled and evaluate SNI visibility and ECH acceptance separately from your egress choice.
Last updated: November 10, 2026.
