Answer
The browser looks up the IP address, opens a TCP connection, and runs a one-round-trip TLS 1.3 handshake. That handshake agrees on fresh encryption keys and verifies the server's identity before the browser sends its first HTTP request.
- The browser sends its key share inside
ClientHello, finishing key agreement in one round trip.1 - Everything after
ServerHellotravels encrypted, including the server's certificate.1 CertificateVerifyproves the server holds the private key matching its certificate.- Both sides discard their one-time key shares afterward, so a future private-key leak cannot decrypt this visit.
Applies toTLS 1.3 over TCPfirst visit to a hostno proxy, no session 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 (encrypted)browser→server· Finishedbrowser→server· GET /server→browser· 200 OK + page
- DNS resolver
Turns the hostname into an IP address so the browser knows where to connect.
- Browser
Opens TCP and sends
ClientHellowith supported cipher suites, the hostname (SNI) and a one-time key share. - Web server
Returns its key share in
ServerHello, then sends its certificate, signature andFinishedmessage under encryption.
How does the browser know this is the real site?
| Check | What the browser verifies |
|---|---|
| Chain | The certificate chains back to a root CA in the browser's trust store. |
| Hostname | The site's domain matches the certificate's Subject Alternative Name (SAN) list. |
| Validity | Today's date falls between the certificate's notBefore and notAfter timestamps. |
| Ownership | CertificateVerify signs the live handshake transcript; only the private-key holder can produce that signature. |
| Revocation | Soft-failStapled OCSP or browser revocation lists check whether the certificate was revoked, often best-effort. |
Where do the session keys come from?
- Key shares
- Browser and server each generate a one-time Diffie-Hellman share, usually
X25519. - Shared secret
- Each side combines its own private share with the other side's public share to reach the same secret.
- Key derivation
- HKDF mixes that secret with the handshake transcript to derive handshake keys, then separate HTTP traffic keys.
- Forward secrecy
- Both sides delete the ephemeral shares after handshake, keeping recorded traffic safe if a server key leaks later.
- Client
Finished - MAC over the full transcript confirming neither side saw tampered messages; HTTP data can follow immediately.
What changes on the next visit?
| Aspect | First visit | Resumed visit |
|---|---|---|
| Server proof | Full certificate chain and live signature check | Pre-shared key from an earlier NewSessionTicket |
| Round trips before HTTP | DNS + 1 RTT TCP + 1 RTT TLS | 0-RTT1 RTT TCP, then request can ride inside ClientHello |
| Replay risk | None; request waits until Finished | Replayable0-RTT early data can be replayed, so servers restrict it to safe reads |