TunnelVision

0005 — Userspace TCP termination for TLS inspection

Context

The extension receives raw IP packets, not sockets. To read or decrypt a TCP byte stream we must present ourselves as the TCP peer to the client — i.e. complete the client’s TCP handshake and deliver an ordered byte stream up to a TLS layer. The kernel socket API won’t do this for traffic arriving as packets on the tunnel.

Decision

For flows selected for inspection, run a userspace TCP endpoint inside the extension that terminates the client connection (ordered stream via our TCPReassembler), then a TLS server presenting a minted leaf, and finally a separate real NWConnection to the true server under standard system trust. Non-inspected flows never enter this path — they are relayed at the IP level. See ../spec/relay-and-tls.md and ../spec/flow-and-reassembly.md.

Consequences

Alternatives considered