No Common Version
Each end has a lowest and a highest TLS version. When the two ranges do not overlap the server answers the hello with a 7-byte alert, number 70, protocol_version, after two flights and before any certificate is sent.
The question
Each end of a TLS connection is set to a lowest and a highest version of the protocol it will speak. What happens when the client's range and the server's range do not overlap, and how far does the handshake get?
Both ends are test endpoints in this tab's memory, made with ssl.tls_pair. Here the client is limited to at most TLS 1.2 and the server to at least TLS 1.3. The certificates and the key are public test material, used only because a server needs them.
Work it by hand
The client's hello lists the versions it is prepared to speak; RFC 9846 section 4.3.1 says that the server MUST only select a version that is in that list. A client limited to TLS 1.2 offers no TLS 1.3, and a server limited to TLS 1.3 will speak nothing else, so there is nothing to select.
The server cannot go on. It answers the hello with an alert instead of a ServerHello. RFC 9846 section 6.2 describes protocol_version as "The protocol version the peer has attempted to negotiate is recognized but not supported". It is alert number 70, hex 46, so the answer should be 7 bytes, 15 03 03 00 02 02 46, and the handshake stops after two flights, with no certificate sent.
Run it
Line 2 makes the server accept only versions from server_min up, and line 4 makes the client speak at most client_max. The loop of lines 7 to 15 takes turns and records each flight that carries bytes with its direction and size (lines 9 to 13). Lines 16 and 17 return the last flight as hex if it is a 7-byte alert, and no plaintext alert otherwise. Lines 18 to 20 return the messages, error() and version().

Watch the steps (recorded video)
Public test material, generated for this lesson. Never use it for anything real.
let server = ssl.server_ctx(ssl.parse_cert(leaf_pem), ssl.parse_key(leaf_key));
server.chain(ssl.parse_cert(int_pem)); server.min_version(server_min);
let client = ssl.client_ctx(); client.add_ca(ssl.parse_cert(root_pem));
client.max_version(client_max);
let pair = ssl.tls_pair(client, server, "www.example.test");
let messages = str_list(); let turns = 0; let last = "";
while (!pair.done() && pair.error() == "" && turns < 10) {
let flight = pair.step(); turns = turns + 1;
if (str_len(flight) > 0) {
last = str_hex_encode(flight);
let way = "1>0|"; if (pair.from() == "client") { way = "0>1|"; }
let size = str(str_len(flight)) + " bytes";
messages.add(way + "flight " + str(turns) + "|" + size);
}
}
let answer = "no plaintext alert";
if (hex_len(last) == 7 && hex_u8(last, 0) == 21) { answer = last; }
lmcode_return_put("messages", messages);
lmcode_return_put("error", pair.error());
lmcode_return_put("version_reported", pair.version());
{
"answer": "15030300020246",
"messages": [
"0>1|flight 1|218 bytes",
"1>0|flight 2|7 bytes"
],
"error": "server handshake: error:0A000102:SSL routines::unsupported protocol",
"version_reported": "TLSv1.2"
}With client_max TLSv1.2 and server_min TLSv1.3 the answer is 15030300020246: a client flight of 218 bytes and a server flight of 7. What this OpenSSL build says: server handshake: error:0A000102:SSL routines::unsupported protocol. version() still returns TLSv1.2, but it is not a result: the handshake did not finish. These come from this run.
You can change client_max and server_min to TLSv1.2 or TLSv1.3. With client_max TLSv1.3 the handshake finishes and the answer is no plaintext alert. With server_min TLSv1.2 and client_max TLSv1.2 it finishes too, with a 218-byte first flight.
Another name stops the run: TLSv1.2x or TLSv1.4 for client_max stops line 4 with "Line 4: TlsCtx.max_version: unknown TLS version 'TLSv1.2x' (use TLSv1.2 or TLSv1.3)" (the name you typed), and for server_min it stops line 2 with the same text from TlsCtx.min_version. An empty name stops too. TLSv1.1 does not stop: this build has no TLS 1.1 to offer, so the client alone gives up with one 7-byte flight and client handshake: error:0A0000BF:SSL routines::no protocols available.
Your turn
The program below sets the lowest and highest version of both ends from client_min, client_max, server_min and server_max, runs the handshake, and should return the version that was negotiated, or none if the handshake did not finish. Decide whether it does, and find the candidates that do. Check runs each candidate on the data shown and on five others.

Public test material, generated for this lesson. Never use it for anything real.
let server = ssl.server_ctx(ssl.parse_cert(leaf_pem), ssl.parse_key(leaf_key));
server.chain(ssl.parse_cert(int_pem));
server.min_version(server_min); server.max_version(server_max);
let client = ssl.client_ctx(); client.add_ca(ssl.parse_cert(root_pem));
client.min_version(client_min); client.max_version(client_max);
let pair = ssl.tls_pair(client, server, "www.example.test");
let turns = 0; let flights = 0;
while (!pair.done() && pair.error() == "" && turns < 10) {
let flight = pair.step(); turns = turns + 1;
if (str_len(flight) > 0) { flights = flights + 1; }
}
let answer = "none";
answer = pair.version();
lmcode_return_put("flights", flights);
{
"answer": "TLSv1.3",
"flights": 2
}A client asks for www.example.test and trusts root_pem; the server holds leaf_pem, int_pem and leaf_key. Both ends are test endpoints in this tab's memory. Set the lowest and highest version of the client from client_min and client_max and of the server from server_min and server_max (each TLSv1.2 or TLSv1.3). Take turns while the pair is not done and has no error, at most ten times. Return the pair's version() if the handshake finished, and none if it did not. Check runs each candidate on the data shown and on five others.
Read the result carefully
The ClientHello says which versions the client offers, and the server picks from that list (RFC 9846 section 4.3.1); the extensions of a hello are walked in tls-13-handshake-trace. This pair's server does not fall back to another version. Names other than TLSv1.2 and TLSv1.3 are not offered by this lesson.
The texts and alert numbers are what this OpenSSL build says and sends; a real server may answer differently or not at all. The certificates are valid from 2026-01-01 to 2036-01-01 and the results hold only between those years. They are test material.
Recap
- Each end has a lowest and a highest version; the client's hello lists what it offers.
- With no version in common the server answers with alert 70,
protocol_version(RFC 9846 section 6.2), after two flights. - No certificate is sent when the versions do not meet.
version()can still return a version after a failure: ask whether the handshake finished first.