roadmap BUILT

501. A TLS client that speaks to one pinned peer

(Number provisional until the merge queue lands it.) Promoted from the proposal a-tls-client-that-speaks-to-one-pinned-peer, filed 2026-09-19 by the lane for milestone 442 (a crypto provider rustls can use on all three bare-metal targets), which built the provider and repriced the client out of its own clause 3. Built 2026-10-06 (UTC) by lane/501-tls.

In brief

The provider 442 assembled has now completed TLS 1.3 handshakes, on all three architectures, with a peer that is not ours (OpenSSL, through Python's ssl), trusting one pinned root and refusing everything else. Off the guest, the same client verified two real Let's Encrypt hosts against ISRG Root X1, the root §250 (an image names its distribution's package index) pins for basalt.nifeos.org.

piece where
The client: a Session made from a PinnedPeer (one DNS name, one root) and nothing else pinned_tls_client/
The production pin, ISRG Root X1, checked byte for byte against two sources pinned_tls_client/roots/
The peer: TLS 1.3 over stdin and stdout, certificate chosen by SNI helpers/tls-peer, a guestfwd at 10.0.2.9:8443 in all four runners
Test authorities, committed with the script that made them pinned_tls_client/fixtures/
The in-guest program and its test pinned_tls_exerciser/, system_tests/src/user/pinned_tls_tests.rs
A std program granted the network, a clock and entropy at once, which no test could start before std_service::start_networked

No dependency is new, which corrects this lane's own brief. It asked for a survey of rustls, embedded-tls and the rest and an architect's ruling before taking any. That was ruled twice already: §196 (nife carries TLS: rustls for the protocol) took rustls over embedded-tls on 2026-09-19, and §198 (the glue is ours, the primitives are not) plus calef's "Take rsa" settled the provider. This milestone links those and http_response (milestone 198 (a package manager)'s rung 3a) and writes the pin, the session and the tests.

What the pin is, and how the client holds it

§196's clause 4: one root for the one source, not a system store. The API makes that the only shape there is: there is no root store to add a second root to, no verifier to swap and no "accept anyway". The tests show it both ways on one port. A well-formed chain from another authority is refused as UnknownIssuer. A control test pins that authority instead and is admitted, so the refusal is about which root. A valid chain from the pinned authority, for another name, is refused as NotValidForName.

The production pin is compiled into the program (PinnedPeer::basalt_index). That is §250's shape rather than a choice made here. An image names its index, so the root that index must chain to is part of the image and covered by its measurement. Granting the root at run time instead would let whoever holds the grant choose what the client trusts, and nothing in §196 or §250 asks for that.

What it costs

Measured on patagonia, under QEMU's TCG, three runs per architecture (two legs each on x86_64), through net_stack over the e1000e to helpers/tls-peer. Each figure includes slirp and a Python peer started per connection, so it bounds the client from above rather than isolating it.

TCP connect handshake (median, range) 256 KiB over TLS (median)
aarch64 44 to 70 ms 162 ms (89 to 682) 208 ms
riscv64 64 to 94 ms 139 ms (121 to 158) 441 ms
x86_64 63 to 98 ms 141 ms (99 to 887) 175 ms

The outliers are each architecture's first run, cold. On the host, the same client took 128 ms and 156 ms to handshake with letsencrypt.org and pages.github.com, which is mostly the round trips. The suite's own test takes under five seconds per architecture. None of this says what radon or xenon will measure, where nothing is emulated and every cipher runs its portable path.

Follow-on

BUGS

Index row

A TLS 1.3 client that trusts exactly one root for one host name, built over the provider of milestone 442. Proved on all three architectures against OpenSSL: the pinned peer answers, and another root or another name is refused. ISRG Root X1 verifies real Let's Encrypt hosts today, through cross-signatures that end on 2032-09-02.