What happens when a browser opens an HTTPS site for the first time?

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.

  1. The browser sends its key share inside ClientHello, so one round trip is enough.1
  2. After ServerHello everything is encrypted, including the server's certificate.1
  3. CertificateVerify proves the server holds the certificate's private key.
  4. 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

1

What crosses the wire before the first request?

First HTTPS visit: DNS to first response
Diagram structure
  • Browser browser
  • DNS resolver dns
  • Web server server
  • browser → dns · DNS query: example.com
  • dns → browser · IP address
  • browser → server · SYN
  • server → browser · SYN + ACK
  • browser → server · ACK
  • browser → server · ClientHello: suites, SNI, key share
  • server → browser · ServerHello: chosen suite, key share
  • server → browser · Certificate + CertificateVerify + Finished, encrypted
  • browser → server · Finished
  • browser → server · GET /
  • server → browser · 200 OK + page
  1. DNS resolver

    Turns the hostname into an IP before the connection can start.

  2. Browser

    Opens TCP and sends ClientHello with TLS 1.3, cipher suites, the hostname and an ephemeral key share.

  3. Web server

    Sends its key share, then certificate and Finished under encryption; checks the client's Finished.

2

How does the browser know this is the real site?

CheckWhat the browser verifies
ChainThe certificate chains to a root CA in the browser's trust store.
HostnameThe site's name appears in the certificate's subject alternative name (SAN) list.
ValidityToday sits inside the certificate's not-before and not-after dates.
OwnershipCertificateVerify signs the handshake transcript; only the private-key holder could produce it.
RevocationWeakStapled OCSP or CRLs, checked best-effort; many browsers accept an unreachable check.
3

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.
4

What changes on the next visit?

AspectFirst visitResumed visit
Server proofFull certificate and signature checkPre-shared key from a NewSessionTicket
Round trips to first byteDNS + TCP + 1 RTT of TLS0-RTTTCP, then data can ride with ClientHello
Early data riskNone; the request waits for FinishedReplayable0-RTT data can be replayed, so servers limit what it may do

Opening diagram…