Skip to content

LAN API over TLS: SDK pinning, lan_tls methods, MCP lan_tls tool - #45

Merged
wardviaene merged 3 commits into
mainfrom
lan-tls
Oct 16, 2026
Merged

wardviaene merged 3 commits into
mainfrom
lan-tls

Conversation

@wardviaene

@wardviaene wardviaene commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

SDK + MCP side of benchpod-firmware#55 (LAN API over TLS on 8443, firmware 3.9.3) and benchpod-cli#41.

  • transport/tls.py + TcpTransport: default port tries TLS on 8443 first, plaintext only when 8443 refuses and nothing is pinned (old pods keep working); :8443 TLS only; other ports and the USB link plaintext. BENCHPOD_TLS, BENCHPOD_TLS_CA. last_tls, command_sequence().
  • Pins in ~/.config/benchpod-cli/known_pods.json, same format as the CLI. TlsPinMismatchError, trust_lan_tls(), forget_lan_tls().
  • BenchPod.lan_tls(), set_lan_tls_https_only(), regenerate_lan_tls(), set_lan_tls_cert() (OTA target tls on one connection), LanTls.
  • MCP: lan_tls tool; README TLS paragraph.
  • Docs: SDK README (TLS on the LAN, env vars, errors, API reference), MCP README, changelogs. API/tool surface snapshots refreshed.

Tests: SDK 686 passed, MCP 161, OpenHTF 74 (new: plan rules, TOFU/mismatch/re-trust against a local TLS server, shared pin format). HW-tested, see below. Versions not bumped (release step).

🤖 Generated with Claude Code

Hardware test (benchpod-a1f6f2, 2026-10-16, Ethernet + USB, no Wi-Fi)

  • TLS 1.2 on 8443, EC P-256 cert generated on first boot (CN/SAN ok). Full handshake 0.46 s (RSA 2048: 1.07 s), resumed ~20 ms (tickets + cache, added after the first run).
  • Heap ~22 KB per TLS session; third session reset; heap back on close.
  • set-cert EC + RSA (persist across reboot), regenerate, trust/forget, --tls-ca, pin mismatch: OK. Fixed: listener went dark after set-cert (rebind refused); now swapped in place.
  • HTTPS-only: on over plaintext; then plaintext 8080 on Ethernet reset, TLS + USB fine, persists across reboot, mDNS https_only=1; off over TLS, USB link and console; changes over plaintext Ethernet refused.
  • SDK e2e over TLS 84/0 (51 s), MCP e2e 7/0. Not tested: the cloud link with this build (a1f6f2 is not registered).

wardviaene and others added 3 commits October 16, 2026 10:50
…n_tls tool

The TCP transport connects to 8443 with TLS when the pod has it (firmware 3.9.3+): default port
tries TLS first and falls back to plaintext only when 8443 refuses and nothing is pinned; :8443 is
TLS only; other ports and the USB link stay plaintext. Pins live in the CLI's known_pods.json
(same format), TlsPinMismatchError on a changed certificate, BENCHPOD_TLS / BENCHPOD_TLS_CA.
BenchPod.lan_tls/set_lan_tls_https_only/regenerate_lan_tls/set_lan_tls_cert (upload as OTA target
tls on one connection: TcpTransport.command_sequence), trust_lan_tls/forget_lan_tls, LanTls.
MCP: lan_tls tool. READMEs and changelogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One SSLContext per CA mode and the last session per pod address: later connections resume in
~35 ms instead of a ~0.46 s full handshake (HW, a1f6f2). A pin change drops the sessions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release prep for the LAN TLS work; not tagged. The MCP server's lan_tls tool needs the SDK's
LanTls and lan_tls methods, so its minimum SDK moves to 2.13.2 (mcp-min-sdk tests the in-repo
SDK until 2.13.2 is on PyPI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene marked this pull request as ready for review October 16, 2026 16:51
@wardviaene
wardviaene merged commit 7c904ae into main Oct 16, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant