mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 12:22:14 +03:00
In startMitm(), read AGENTBRIDGE_UPSTREAM_CA_CERT (env wins over stored path in <dataDir>/mitm/upstream-ca.path) and call configureUpstreamCa() at process start; failures are caught and logged — boot continues without custom CA. In the POST /api/tools/agent-bridge/upstream-ca handler, call configureUpstreamCa() immediately after persisting the new path so the CA takes effect without reboot; throws → 400 with sanitizeErrorMessage (Hard Rule #12). New test file tests/unit/mitm-upstream-ca-wiring.test.ts validates the path-selection logic and the route wiring (8 tests, 0 failures).