feat(server): split agent mTLS and browser HTTP listeners (VS-62) #84
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VS-62-two-listener-agent-mtls-browser-http"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bind two listeners with independent TLS modes instead of one socket whose TLS mode was a global either/or. A dedicated agent listener (default 0.0.0.0:15443, configurable via --agent-bind / VERVAIN_AGENT_BIND) presents vervain's own server cert AND requires + verifies a client cert chaining to the dedicated agent CA (VS-63) via a rustls WebPkiClientVerifier, serving only the agent control + relay routes. The browser listener keeps its existing per-listener TLS mode (terminate or offload behind Traefik) and serves the SPA, the browser API, and the token-based enrollment endpoint, which stays reachable without a client cert because the enrolling agent has none yet.
The agent listener comes up alongside the browser listener whenever its address differs from the browser bind, so the typical offload deployment runs both (browser HTTP :15080, agent mTLS :15443). When the two binds are equal (the default terminate-mode single port) the agent routes stay on the main listener and no separate mTLS listener is started, preserving the single-port path.
Remove the insecureSkipVerify re-encrypt workaround: the ProxyCertCache / VERVAIN_CERT_URL / settings.tls.certUrl path and the handshake's extra-server-hash acceptance it fed are deleted, since agents now reach a direct mTLS port instead of seeing a reverse proxy's cert. ServerConfig gains agent_bind / agent_cert_pem / agent_key_pem and ServerHandle drives both listeners' shutdown in lockstep.
Add an integration test that proves, at the TLS layer, that the agent listener rejects a client presenting no cert, accepts an agent-CA-issued client cert, and that the browser listener serves /health without a client cert.
#VS-62
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com