How the Internet works

Names and Trust, chapter 26 of 36

TLS 1.3: The Handshake

Our TLS 1.3 ClientHello says TLS 1.0 in its record header and TLS 1.2 inside. Only an extension tells the truth.

Sixteen milliseconds after the click, the SYN-ACK is in and the laptop's ACK leaves. In the same instant the browser hands the kernel 1,732 bytes for port 443: one TLS record, too big for one TCP segment because one of its key shares is built to resist a quantum computer that does not exist yet. One round trip later both ends hold keys that no one else on the path can compute.

1,732 bytes
our ClientHello, in two TCP segments, because its hybrid key share alone is 1,216 bytes
92.3 percent
of 2017 Chrome beta handshakes to TLS 1.3-capable servers that succeeded with draft 18, against 98.3 with TLS 1.2
70 percent
about that much browser traffic to Cloudflare used hybrid ML-KEM in September 2026, but only about 15 percent of origins

Two observers, one handshake

Our handshake in five steps, record by record. Step through them and switch between the endpoints and a middlebox on the path to see which fields stay readable and which secrets each observer holds.

What did TLS 1.3 throw away?

Almost everything an attack had used. RFC 9852, Section 6 lists the TLS 1.2 catalog: renegotiation and the triple handshake, Lucky Thirteen against CBC padding, BEAST, Logjam, FREAK, and SLOTH. RFC 10015, Section 1 adds that RSA key exchange has no forward secrecy by construction.

TLS 1.3 removed the mechanisms themselves (RFC 9846, Section 1.3). Without static RSA and static Diffie-Hellman, every certificate-authenticated handshake is forward secret. Everything after the ServerHello is encrypted, the certificate included. The full handshake takes one round trip where TLS 1.2 took two, because the client guesses the key exchange group and sends its share in the first message.

Why does a TLS 1.3 hello claim to be TLS 1.2?

Because servers and middleboxes broke when it told the truth. Clients answered version intolerance with fallback, and an active attacker could cause the failure on purpose. TLS 1.3 keeps legacy_version at 0x0303, and a server that sees supported_versions must not negotiate with legacy_version (RFC 9846, Section 4.3.1).

With draft 18, whose ServerHello still looked like TLS 1.3, only 92.3 percent of Chrome beta handshakes to TLS 1.3-capable servers succeeded [Rescorla2017a]. Draft 22 made TLS 1.3 look like a TLS 1.2 resumption, with an echoed session ID and a dummy ChangeCipherSpec (RFC 9846, Appendix E.4). This variant completed 98.8 percent in Chrome's second round, against 98.6 for TLS 1.2.

How do you keep an extension point from rusting shut?

You exercise it. David Benjamin's RFC 8701 reserves sixteen values of the form 0x?A?A for cipher suites, ALPN identifiers, extensions, groups, signature algorithms, and versions, for clients to send at random (RFC 8701, Section 2). A correct server ignores them. A broken one fails at once, while the bug is still rare enough to get fixed.

Our hello carries six, from an empty extension 0x5a5a at the front to a one-byte extension 0x1a1a at the end. BoringSSL avoids ending a hello over TCP on an empty extension. A comment in its code says that WebSphere Application Server 7.0 fails when the last extension has zero length [BoringSSL2026].

Where do the keys come from?

From HKDF, Hugo Krawczyk's two-step key derivation function. Extract concentrates unevenly distributed input, such as a Diffie-Hellman result, into a pseudorandom key, and Expand stretches that key into as many outputs as needed (RFC 5869, Section 1). Every traffic secret is bound to a hash of the messages exchanged so far.

Without a PSK the schedule still runs, with zeros as input. So every SHA-256 handshake without a PSK starts from the same Early Secret, 33 ad 0a 1c ..., and the first connection-specific secret is the Handshake Secret. Finished, an HMAC over the transcript, catches a man in the middle who deleted an offered group or version.

Why is one key share 1,216 bytes long?

Because of harvest-now-decrypt-later. An attacker who records today's handshakes can decrypt them once a quantum computer breaks elliptic-curve Diffie-Hellman, while authentication cannot be broken after the fact. So key exchange had to move first (RFC 9954, Section 1.2).

For X25519MLKEM768 (0x11EC) the client sends a 1,184-byte ML-KEM-768 encapsulation key plus a 32-byte X25519 share, and the server answers with 1,120 bytes. The X25519 half stays because ML-KEM, standardized as FIPS 203 in August 2024, lacks the decades of study behind elliptic curves. The name breaks the naming rule, with ML-KEM first "due to historical reasons" (RFC 10024, Section 4.1).

Who can still read the name www.example.net?

Anyone on the path, at offset 0x67 of our ClientHello. TLS 1.3 encrypts the certificate but not the name, which RFC 9849, Section 1 calls "perhaps the most sensitive information left unencrypted".

Encrypted Client Hello encrypts the real ClientHello to a key that a client-facing server publishes, usually in an HTTPS record. www.example.net publishes none, so our laptop sends a GREASE ECH extension: a random config ID, a fresh X25519 key, and 176 random bytes (RFC 9849, Section 6.2.1). It protects nothing by itself. Sent widely, it makes real ECH look ordinary, so that networks cannot single it out.

laptop :51514server :443 ClientHello (1732 bytes)ServerHello, ChangeCipherSpec{EE, Certificate, CertVerify, Finished}ChangeCipherSpec, {Finished}, [HTTP/2][NewSessionTicket], [response]
From the book: Our TLS 1.3 handshake; {} marks handshake keys, [] application keys

The book keeps asking

This chapter has 5,614 words and 15 questions. These 9 are answered only in the book and the audiobook.

  • How did a Netscape protocol become TLS 1.3?
  • What changed in RFC 9846?
  • What exactly does the laptop say?
  • What does the server send back?
  • What does a protected record look like?
  • Which signature proves the server's identity?
  • How does the second visit skip the expensive part?
  • Is a saved round trip worth a replay?
  • What changes when TLS runs over UDP?

Open the sources

  • RFC 9846 The Transport Layer Security (TLS) Protocol Version 1.3 2026, Proposed Standard
  • RFC 8446 The Transport Layer Security (TLS) Protocol Version 1.3 2018, Proposed Standard; obsoleted by RFC 9846
  • RFC 5869 HMAC-based Extract-and-Expand Key Derivation Function (HKDF) 2010, Informational
  • RFC 8448 Example Handshake Traces for TLS 1.3 2019, Informational
  • RFC 9954 Hybrid Key Exchange in TLS 1.3 2026, Informational
  • RFC 10024 Post-Quantum Traditional (PQ/T) Hybrid Key Agreement Mechanisms for TLS 1.3 2026, Proposed Standard
  • RFC 9849 TLS Encrypted Client Hello 2026, Proposed Standard
  • RFC 8701 Applying Generate Random Extensions And Sustain Extensibility (GREASE) to TLS Extensibility 2020, Informational

All 45 documents this chapter cites, each with a link to its publisher and a copy kept here.

Names and Trust, chapter 27 of 36

Certificates and the Web PKI

Applications, chapter 28 of 36

HTTP: Semantics and HTTP/1.1

Applications, chapter 29 of 36

HTTP/2: Multiplexing over One Connection

Applications, chapter 30 of 36

QUIC: A Transport in Userspace

Applications, chapter 31 of 36

HTTP/3: The Web on QUIC

Applications, chapter 32 of 36

Mail: SMTP and Forty Years of Patches

Applications, chapter 33 of 36

Time, Shells, and Files: NTP, SSH, Telnet, and FTP

The Whole Path, chapter 34 of 36

Measuring and Debugging the Path

The Whole Path, chapter 35 of 36

The Whole Journey, Byte by Byte

The Whole Path, chapter 36 of 36

Ossification and What Comes Next

You have reached the server. The book goes further.

Everything on this site is a short version. Follow the Packet is the long one: 36 chapters and about 280,000 words, with every protocol fact traced to the section of the standard that defines it, every byte dump built by a script you can run, and a directory of more than a thousand cited documents. It comes as a printable book and as an audiobook.

Hear how chapter 1 opens. 70 seconds, narrated by a synthetic voice.

Get the book or the audiobook Read the start of chapter 1 Browse every source

Cover of Follow the Packet: How the Internet Works, Layer by Layer, from ARPANET to QUIC, by Wolfgang Kerschbaumer

The signup uses double opt-in. Every message includes an unsubscribe link.

Published by Sysinit Press. The public addresses, AS numbers and names of the scenario come from ranges reserved for documentation, and the home network uses private addresses, so the site describes no real network. RFC texts are copied unchanged from the RFC Editor.