diegosouzapw/OmniRoute · error · Error

Certificate file not found

Error message

Certificate file not found: ${certPath}

What it means

Precondition check in installCert: fs.existsSync(certPath) is false — the PEM file to install into the system trust store is not on disk. Means the MITM CA was never generated, was deleted, or the path configured for the operation points nowhere; nothing can be installed until the cert exists.

Solutions

  1. Generate the MITM root CA first (start the MITM proxy so it creates the cert)
  2. Check the cert path in the request/settings for typos
  3. Restore the cert from backup if it was deleted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/mitm/cert/install.ts:194 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/069644d470b5326d. Report an issue: GitHub.

Appendix: source

Thrown at src/mitm/cert/install.ts:194

export function certutilThumbprint(certPath: string): string {
  return getCertFingerprint(certPath).replace(/:/g, "");
}

async function checkCertInstalledWindows(certPath: string): Promise<boolean> {
  try {
    await execFileText("certutil", ["-store", "Root", certutilThumbprint(certPath)]);
    return true;
  } catch {
    return false;
  }
}

/**
 * Install SSL certificate to system trust store
 */
export async function installCert(sudoPassword: string, certPath: string): Promise<void> {
  if (!fs.existsSync(certPath)) {
    throw new Error(`Certificate file not found: ${certPath}`);
  }

  const isInstalled = await checkCertInstalled(certPath);
  if (isInstalled) {
    // #9442: the fingerprint matched, but a restrictive umask at install time
    // may have left the system cert as 0600 — unreadable by non-root TLS
    // clients (curl, reqwest, uv, Python requests). Repair the mode before
    // the early return so re-running install fixes a previously wrong-mode
    // cert instead of silently skipping it.
    if (!IS_WIN && !IS_MAC) {
      const config = getLinuxCertConfig();
      await ensureSystemCertMode(`${config.dir}/${LINUX_CERT_NAME}`, sudoPassword);
    }
    console.log("✅ Certificate already installed");
    return;
  }

  if (process.env.OMNIROUTE_SKIP_SYSTEM_TRUST === "1") {

View on GitHub (pinned to a179ffed5b)