Answer
The browser resolves the hostname, opens TCP, then runs a one-round-trip TLS 1.3 handshake. It agrees fresh encryption keys and checks the server's identity before any request is sent.
- The browser sends its key share inside
ClientHello, so one round trip is enough.1 - After
ServerHelloeverything is encrypted, including the server's certificate.1 CertificateVerifyproves the server holds the certificate's private key.- Keys come from ephemeral shares, so a later leak of the private key cannot decrypt this session.
Applies toTLS 1.3 over TCPfirst visit to a hostno proxy, no resumption
What crosses the wire before the first request?
Diagram structure
- Browser
browser - DNS resolver
dns - Web server
server browser→dns· DNS query: example.comdns→browser· IP addressbrowser→server· SYNserver→browser· SYN + ACKbrowser→server· ACKbrowser→server· ClientHello: suites, SNI, key shareserver→browser· ServerHello: chosen suite, key shareserver→browser· Certificate + CertificateVerify + Finished, encryptedbrowser→server· Finishedbrowser→server· GET /server→browser· 200 OK + page
- DNS resolver
Turns the hostname into an IP before the connection can start.
- Browser
Opens TCP and sends
ClientHellowith TLS 1.3, cipher suites, the hostname and an ephemeral key share. - Web server
Sends its key share, then certificate and
Finishedunder encryption; checks the client'sFinished.
How does the browser know this is the real site?
| Check | What the browser verifies |
|---|---|
| Chain | The certificate chains to a root CA in the browser's trust store. |
| Hostname | The site's name appears in the certificate's subject alternative name (SAN) list. |
| Validity | Today sits inside the certificate's not-before and not-after dates. |
| Ownership | CertificateVerify signs the handshake transcript; only the private-key holder could produce it. |
| Revocation | WeakStapled OCSP or CRLs, checked best-effort; many browsers accept an unreachable check. |
Where do the session keys come from?
- Key shares
- Each side sends an ephemeral Diffie-Hellman share, usually X25519.
- Shared secret
- Each side combines its private share with the peer's public share.
- Key schedule
- HKDF expands the secret plus the transcript into handshake, then traffic keys.
- Forward secrecy
- Shares are discarded after use, so later key theft cannot decrypt this session.
- Client
Finished - Confirms both sides hold the same keys; the request can now ride on them.
What changes on the next visit?
| Aspect | First visit | Resumed visit |
|---|---|---|
| Server proof | Full certificate and signature check | Pre-shared key from a NewSessionTicket |
| Round trips to first byte | DNS + TCP + 1 RTT of TLS | 0-RTTTCP, then data can ride with ClientHello |
| Early data risk | None; the request waits for Finished | Replayable0-RTT data can be replayed, so servers limit what it may do |