feat(web): TLS offload via VERVAIN_CERT_URL reverse-proxy cert fetch (VS-27) #39
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tls-offload-cert-url-VS-27"
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?
Implements VS-27: run the server behind a TLS-terminating reverse proxy (Traefik, Caddy, nginx) without forcing TCP passthrough (serversTransport). Mirrors upstream MeshCentral's certUrl concept via the
VERVAIN_CERT_URLenv var.What changed
meshcentral-web/src/proxy_cert.rs:ProxyCertCachedialsVERVAIN_CERT_URLover TLS (accept-any verifier, mirroring the dangerous-config pattern inmeshcentral-peering::cert_pinning; the fetched bytes only RECOGNIZE what agents see, they are never a trust anchor), captures the proxy's leaf cert, and stores its SPKI SHA-384. Startup fetch plus on-mismatch refetch rate-limited to one attempt per 60 seconds, so a rotated proxy cert heals on the agent's automatic reconnect without a restart.agent_handshake.rs: the handshake accepts extra server hashes alongside the web signer's own, records the hash the agent reported seeing, and reconstructs the agent-signature digest from that recorded hash in both the RSA and ECDSA verify paths (the agent signs over what it saw). Unknown hashes are a newUnknownServerHasherror. With no proxy configured the recorded hash equals the signer's, so behavior is unchanged.agent.rs: snapshots the cache into each handshake; anUnknownServerHashrejection spawns the rate-limited refetch off the connection path.main.rs: readsVERVAIN_CERT_URL; a failed startup fetch logs server warning id 102 and the server boots normally (per VS-27 decision).meshcentral-pki:sha384_of_subject_public_keyis now public so the fetcher hashes the proxy cert with the exact recipe agents use..env.exampleentry.Unchanged on purpose
ServerIDinmeshsettings.ashxand the server's ownAuthRequesthash stay the web signer's pubkey hash; the server signing identity is unaffected by offload.Pre-existing breakage fixed in passing
cargo test --workspacedid not compile on main: VS-26 addedsetup_enabledtoServerConfigbut missed theadmin.rs,login.rs, andtls_smoke.rsintegration tests. Both that field and the newproxy_certfield are now populated there.Tests
🤖 Generated with Claude Code