Done Is Not Verified
After the loop the pair answers seven questions, and they are separate facts: done, verified and the others. Read each answer for what it says and what it does not.
The question
After the loop, the pair can be asked seven things: done(), version(), cipher(), group(), server_name(), verified() and verify_result(). It is tempting to read one of them and conclude the rest. Is a handshake that is done also verified? Is a handshake that is not done also not verified?
This lesson keeps the answers apart. The two ends are test endpoints in this tab's memory, the certificates and the key are test material, and the reader's page set the policy of both.
Work it by hand
Take the handshake of the first lesson, with everything accepted. It finished, so done() is true; the client checked the chain against the root that the page gave it and the name against host, so verified() is true and verify_result() says ok. The version, the cipher, the group and the server name are what was negotiated.
Now suppose the client is told not to check. The handshake can still finish with a certificate for another name. Then done() is true and verified() is false, and verify_result() names the problem. The next run shows the first case; Your turn sets check to off for the second.
Run it
The program runs the standard block and loop of this book, and then returns the seven answers, one in each of lines 10 to 16. Line 17 joins three of them into one text, so that an edit changes the answer. The group is from this build (lmssl 0.2.2, OpenSSL 4.0.3). The program never calls pair.peer(): after a refused certificate it stops the program.

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.groups("X25519");
let client = ssl.client_ctx(); client.add_ca(ssl.parse_cert(root_pem));
client.groups("X25519");
let pair = ssl.tls_pair(client, server, host);
let turns = 0;
while (!pair.done() && pair.error() == "" && turns < 10) {
let flight = pair.step(); turns = turns + 1;
}
lmcode_return_put("done", str(pair.done()));
lmcode_return_put("version", pair.version());
lmcode_return_put("cipher", pair.cipher());
lmcode_return_put("group", pair.group());
lmcode_return_put("server_name", pair.server_name());
lmcode_return_put("verified", str(pair.verified()));
lmcode_return_put("verify_result", pair.verify_result());
let answer = str(pair.done()) + " " + pair.version() + " " + pair.cipher();
{
"answer": "true TLSv1.3 TLS_AES_256_GCM_SHA384",
"done": "true",
"version": "TLSv1.3",
"cipher": "TLS_AES_256_GCM_SHA384",
"group": "x25519",
"server_name": "www.example.test",
"verified": "true",
"verify_result": "ok"
}The picture lists the seven answers. You can change host. A name that the certificate does not cover, such as shop.example.test, makes the client refuse the certificate: done is false and verify result reads hostname mismatch, with verified false and the answer starting false. A name of one character, such as x, stops line 5 with "Line 5: Ssl.tls_pair: set host to verify". The four PEM texts are test material: leave them as they are.
Your turn
The program below is meant to return trusted, unchecked or failed. check is on or off and sets client.verify(check == "on"); client_max is TLSv1.3 or TLSv1.2, and the server accepts only TLS 1.3. A version name that OpenSSL does not know, such as TLSv1.4, stops line 4 with "Line 4: TlsCtx.max_version: unknown TLS version 'TLSv1.4' (use TLSv1.2 or TLSv1.3)". Any check other than on counts as off.
Decide whether the program does what it should, and find the candidates that do. Check runs each candidate on the data shown and on seven 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("TLSv1.3");
let client = ssl.client_ctx(); client.add_ca(ssl.parse_cert(root_pem));
client.verify(check == "on"); client.max_version(client_max);
let pair = ssl.tls_pair(client, server, host);
let turns = 0;
while (!pair.done() && pair.error() == "" && turns < 10) {
let flight = pair.step(); turns = turns + 1;
}
let answer = "failed";
if (pair.done()) { answer = "trusted"; }
lmcode_return_put("turns", turns);
{
"answer": "trusted",
"turns": 4
}The program builds a TLS server that accepts only TLS 1.3 and a TLS client from the test chain, with client.verify(check == "on") and the client's highest version set to client_max, joins them in memory and steps them to the end. Return a text: trusted if the handshake finished and the client's certificate check passed, unchecked if it finished although the certificate check did not pass, failed if it did not finish. Check runs your program with other names, settings and test material.
Read the result carefully
A handshake that fails before any certificate arrives, for instance because the client allows at most TLS 1.2 and the server at least TLS 1.3, reports verified() true and verify_result() ok with done() false. That is what lmssl reports, whatever check says; nothing was checked, so nothing failed. Read verified() only together with done(). The page measured it and explains it no further.
"Verified" here means verified against the root this page handed to the client, with names the page chose: both ends are programs in this tab, and the reader set the policy of both. The page shows no revocation check, no certificate transparency, no client certificate, no resumption and no timing, and lengths and names are what this build does.
The test chain is valid from 2026-01-01 to 2036-01-01 and the client checks the dates against the reader's clock: outside those years the client refuses the certificate. For how a chain is checked see A Certificate Chain Trusts a Root, and for the fields of a certificate A Certificate, Field by Field.
Compare these checks with failures you can trigger.
Recap
done(),verified()andverify_result()are separate facts.- A client told not to check can finish with a certificate for another name.
- Read
verified()only together withdone(). - "Verified" means checked against the root that this page gave the client.