A TLS 1.3 Handshake, Message by Message

One recorded loopback TLS 1.3 handshake, read message by message with real primitives: the records, the hellos, the key schedule, a record opened by hand, CertificateVerify and Finished. A recording of one connection between two test programs; the secrets are test material and protect nothing. To run a fresh handshake with your own client and server in the tab, start with A TLS 1.3 Handshake You Can Step Through (/tls-13-handshake-live/); for failures, see TLS Failures You Can Trigger (/tls-failures-you-can-trigger/).

The Hellos

The records, the ClientHello with its extensions, and the ServerHello that answers it.

  1. The Handshake Is Thirteen Records

    13 records, three outer types

  2. ClientHello, Fixed Fields

    version, random, session id, suites, extensions

  3. ClientHello Extensions

    type, length, data; the real version choice

  4. ServerHello Picks

    suite, version and key share chosen by the server

The Protected Flight

Keys from the logged secrets, one record opened by hand, CertificateVerify and Finished.

  1. Keys From the Secret

    HkdfLabel, tls13 key, tls13 iv

  2. A Record Opens With Its Nonce

    nonce = IV xor sequence number

  3. CertificateVerify Signs the Transcript

    the 130 bytes that the server signs

  4. Finished Closes the Handshake

    the finished key and the 36-byte message