wire / wire-format / tls-record
A TLS record consists of a 5-byte header (content type 1 byte, legacy version 2 bytes, length 2 bytes) followed by the (possibly encrypted) fragment. In TLS 1.3 the real content type moves into the encrypted payload (inner content type).
aka: TLS 1.3 record layer
spec: RFC 8446
A TLS record consists of a 5-byte header (content type 1 byte, legacy version 2 bytes, length 2 bytes) followed by the (possibly encrypted) fragment. In TLS 1.3 the real content type moves into the encrypted payload (inner content type).
| field | size | meaning |
|---|---|---|
| Content Type | 1 byte | Outer type: 0x17 application data (all TLS 1.3 records), or 0x14 change cipher spec, 0x15 alert, 0x16 handshake for legacy. |
| Legacy Version | 2 bytes | 0x0303 (TLS 1.2) for compatibility; ignored in TLS 1.3. |
| Length | 2 bytes | Fragment length in octets (max 2^14 + 256). |
example:
17 03 03 00 05 48 65 6c 6c 6f
Application data record, TLS 1.2 legacy version, 5-byte fragment 'Hello'
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/tls-record
or /wire-format/tls-record.json