diegosouzapw/OmniRoute · error · Error
TPROXY CA trust install is Linux-only.
Error message
TPROXY CA trust install is Linux-only.
What it means
Platform guard in installTproxyCa: the TPROXY CA trust-store installation only works on Linux (iptables/nftables TPROXY + update-ca-certificates ecosystem), and the current host is not Linux (or the platform check failed). Note OMNIROUTE_SKIP_SYSTEM_TRUST=1 short-circuits before this check with a log line; otherwise the install is refused outright.
Solutions
- Run the TPROXY capture mode on a Linux host
- Set OMNIROUTE_SKIP_SYSTEM_TRUST=1 to skip OS trust mutation (only when you manage trust manually)
- Use the platform-appropriate interception mode (MITM proxy) on non-Linux hosts
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/mitm/tproxy/caTrust.ts:87 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/a9e292a157946b63.
Report an issue: GitHub.
Appendix: source
Thrown at src/mitm/tproxy/caTrust.ts:87
};
/**
* Install the dynamic CA cert (PEM) into the OS trust store under the dedicated
* TPROXY slot. Stages the PEM to a temp file, then (privileged) copies it into the
* anchor dir and refreshes the trust store. Throws on non-Linux hosts.
*/
export async function installTproxyCa(
caPem: string,
sudoPassword = "",
deps: Partial<CaTrustDeps> = {}
): Promise<void> {
if (process.env.OMNIROUTE_SKIP_SYSTEM_TRUST === "1" && deps.run === undefined) {
console.log("[tproxy-ca] OMNIROUTE_SKIP_SYSTEM_TRUST=1 — skipping OS trust-store mutation");
return;
}
const d = { ...realDeps, ...deps };
if (d.platform() !== "linux") {
throw new Error("TPROXY CA trust install is Linux-only.");
}
const cfg = d.certConfig();
const staged = path.join(d.tmpDir(), TPROXY_CA_CERT_NAME);
const dest = `${cfg.dir}/${TPROXY_CA_CERT_NAME}`;
d.writeFile(staged, caPem);
try {
await d.run("sudo", ["-S", "mkdir", "-p", cfg.dir], sudoPassword);
await d.run("sudo", ["-S", "cp", staged, dest], sudoPassword);
await d.run("sudo", ["-S", cfg.cmd], sudoPassword);
} finally {
d.rmFile(staged);
}
}
/**
* Remove the TPROXY CA from the OS trust store (its dedicated slot only — leaves
* the static MITM cert untouched) and refresh. No-op on non-Linux hosts.
*/View on GitHub (pinned to a179ffed5b)