← Back to Blog
MILESTONE · 0.7.0 · OS · HTTPS

TLS 1.3 Minimal Client — HTTPS Pipeline Foundation

osnettlshttpssecurity0.7.0

os_tls.sg establishes the TLS 1.3 minimal client foundation for HTTPS support. This completes the HTTPS pipeline after DNS resolution (os_net_resolve.sg) and the browser→OS network path (os_net_handler.sg). The net stack can now: resolve hostnames → open TCP connections → negotiate TLS 1.3 → send/receive encrypted HTTP. All tests PASS on QEMU raspi3b.

TLS 1.3 client

os_tls.sg
ClientHello generation — builds TLS 1.3 ClientHello with supported_versions (0x0304), cipher suites (TLS_CHACHA20_POLY1305_SHA256), key_share extension (x25519 placeholder — scalar multiply stub ready for crypto implementation).
ServerHello parser
ServerHello parse — extracts server random (32 bytes), selected cipher suite, key_share extension (server's x25519 public key). Validates TLS version = 0x0304, rejects downgrade.
X.509 cert parser
Certificate stub — parses Certificate message, extracts DER-encoded certificate chain. Verification stub ready for trust-anchor implementation.
ChaCha20-Poly1305
AEAD cipher stub — ChaCha20-Poly1305 encrypt/decrypt interface with nonce management. Crypto implementation stubs ready for real x25519 + AEAD. Chosen as TLS_CHACHA20_POLY1305_SHA256 — constant-time on all platforms (no AES-NI dependency), ideal for the Pi 3 floor.

Net stack pipeline complete

The browser→OS network path now has all layers wired:

browser tab → IPC NET_REQUEST → os_net_handler → os_net_resolve (DNS A-record) → tcp_connect → os_tls (TLS 1.3 handshake) → http_fetch → NET_RESPONSE → browser tab

Crypto stubs (x25519 scalar multiply, actual ChaCha20-Poly1305 AEAD) are the next step — the protocol framing and message flow is complete.