ServerHello Picks
The recorded ServerHello picks cipher suite 1301, selects TLS 1.3 in supported_versions and answers the client's x25519 key share with its own 32-byte share.
The question
The client has offered a key share and a list of cipher suites. What does the server's answer pick, and where in the ServerHello does it say so?
This page reads the ClientHello and the ServerHello of one recorded loopback connection between two test programs, made on 2026-11-20 with OpenSSL 4.0.3 and kept as test material. A ServerHello contains the chosen cipher suite, the version in an extension and a key share of the server's own, for one group the client offered (RFC 9846, 4.2.3 and 4.3.8). A HelloRetryRequest (RFC 9846, 4.2.4) is not in this recording.
Work it by hand
The ClientHello of the recording offers one key share. Its extension is 00 33 00 26 00 24 00 1d 00 20 followed by 32 bytes: type 51, length 38, a list of 36 bytes holding one entry, group 001d (x25519) and a key of 0020, 32, bytes.
The ServerHello has the extension 00 33 00 24 00 1d 00 20 followed by 32 bytes: type 51, length 36, no list, one entry. The suite sits just before the compression byte, at bytes 76 and 77 of the record; the value 1301 is TLS_AES_128_GCM_SHA256 (IANA TLS Cipher Suites, read 2026-11-20). The server's reply names the same group as the client's entry, and a key of the same length.
Run it
The program takes the two records as hex, the ClientHello in client and the ServerHello in reply. The function of lines 1 to 8 walks an extension block from start and returns the offset of the data of the extension it is asked for. Lines 9 to 11 locate the ClientHello's extension block and ask for the key share; lines 12 to 13 do the same for the ServerHello. The rows come from lines 18 to 20; line 24 returns them.

Watch the steps (recorded video)
Public test material, generated for this lesson. Never use it for anything real.
fn ext_at(hello: string, start: int, want: int) -> int {
let at = start; let found = 0 - 1;
while (at + 4 <= hex_len(hello)) {
if (hex_u16(hello, at) == want) { found = at + 4; }
at = at + 4 + hex_u16(hello, at + 2);
}
return found;
}
let a = 44 + hex_u8(client, 43);
let comp = a + 2 + hex_u16(client, a);
let p = ext_at(client, comp + 1 + hex_u8(client, comp) + 2, 51);
let suite_at = 44 + hex_u8(reply, 43);
let q = ext_at(reply, suite_at + 5, 51);
let names = str_list(); names.add(hex_slice(client, p + 2, 2));
names.add(hex_slice(reply, q, 2));
let rows = str_list();
let n1 = hex_u16(client, p + 4); let n2 = hex_u16(reply, q + 2);
rows.add("offers|" + names.at(0) + ", " + str(n1) + " bytes");
rows.add("selects|" + names.at(1) + ", " + str(n2) + " bytes");
rows.add("suite|" + hex_slice(reply, suite_at, 2));
lmcode_return_put("offered", names.at(0));
lmcode_return_put("selected", names.at(1));
lmcode_return_put("suite", hex_slice(reply, suite_at, 2));
let answer = rows;
{
"answer": [
"offers|001d, 32 bytes",
"selects|001d, 32 bytes",
"suite|1301"
],
"offered": "001d",
"selected": "001d",
"suite": "1301"
}You can change both records if each is a hello that carries a key share: the offsets follow the lengths in the record. A ServerHello without a key_share extension stops the run with "bytes -1 to 0 are past the end of the data" (measured with a constructed record). The page takes at most 1024 bytes of hex for each input.
Your turn
A parser wants the choices that a ServerHello records. The program below is meant to return a list of four texts for a ServerHello record: the chosen cipher suite, the selected TLS version and the group of the key share, each as 4 hex digits, and the length of the server's key share in bytes as a decimal text. Decide whether it does, and find the candidates that do. Check runs each candidate on the record shown and on five others.
The record shown is the ServerHello of RFC 8448, section 3 (published bytes), with a record header added here; the others are built by hand from the same layout. They are test material and not captures.

Public test material, generated for this lesson. Never use it for anything real.
let end = hex_len(record);
let at = 44 + hex_u8(record, 43);
let suite = hex_slice(record, at, 2);
let version = ""; let group = ""; let klen = 0;
at = at + 5;
while (at + 4 <= end) {
let size = hex_u16(record, at + 2);
let kind = hex_u16(record, at);
if (kind == 43) { version = hex_slice(record, at + 4, 2); }
if (kind == 51) {
group = hex_slice(record, at + 4, 2);
klen = hex_u8(record, at + 6);
}
at = at + 4 + size;
}
let answer = str_list();
answer.add(suite); answer.add(version);
answer.add(group); answer.add(str(klen));
{
"answer": [
"1301",
"0304",
"001d",
"0"
]
}Return a list of four texts for a ServerHello record: the cipher suite, the version in supported_versions and the group of the key share, each as 4 hex digits, and the length of the server's key share in bytes as a decimal text.
Read the result carefully
The selections are read from one ServerHello. The page does not prove that a real server would pick the same, and the group is x25519 in this recording only because the recording asked for it; a default client offers other groups. The ServerHello's legacy_version is 0303 as well: the choice of TLS 1.3 is the supported_versions extension.
The order of the extensions is not fixed: the recording puts supported_versions first and the RFC 8448 trace puts the key share first, so a parser must walk the block. A hand-built record is not a capture, and the page shows nothing of what happens after the hello.
Recap
- The ServerHello names one cipher suite, one version (in supported_versions) and one key share.
- In the recording the suite is
1301, the version0304and the group001dwith a 32-byte key. - The server's key_share extension carries one entry; the client's carries a list.
- A HelloRetryRequest is not in this recording; the order of the extensions is not fixed.