{"record":{"id":"069644d470b5326d","repo":"diegosouzapw/OmniRoute","slug":"certificate-file-not-found-certpath","errorCode":null,"errorMessage":"Certificate file not found: ${certPath}","messagePattern":"Certificate file not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mitm/cert/install.ts","lineNumber":194,"sourceCode":"export function certutilThumbprint(certPath: string): string {\n  return getCertFingerprint(certPath).replace(/:/g, \"\");\n}\n\nasync function checkCertInstalledWindows(certPath: string): Promise<boolean> {\n  try {\n    await execFileText(\"certutil\", [\"-store\", \"Root\", certutilThumbprint(certPath)]);\n    return true;\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Install SSL certificate to system trust store\n */\nexport async function installCert(sudoPassword: string, certPath: string): Promise<void> {\n  if (!fs.existsSync(certPath)) {\n    throw new Error(`Certificate file not found: ${certPath}`);\n  }\n\n  const isInstalled = await checkCertInstalled(certPath);\n  if (isInstalled) {\n    // #9442: the fingerprint matched, but a restrictive umask at install time\n    // may have left the system cert as 0600 — unreadable by non-root TLS\n    // clients (curl, reqwest, uv, Python requests). Repair the mode before\n    // the early return so re-running install fixes a previously wrong-mode\n    // cert instead of silently skipping it.\n    if (!IS_WIN && !IS_MAC) {\n      const config = getLinuxCertConfig();\n      await ensureSystemCertMode(`${config.dir}/${LINUX_CERT_NAME}`, sudoPassword);\n    }\n    console.log(\"✅ Certificate already installed\");\n    return;\n  }\n\n  if (process.env.OMNIROUTE_SKIP_SYSTEM_TRUST === \"1\") {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/cert/install.ts#L176-L212","documentation":"Error \"Certificate file not found: ${certPath}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/mitm/cert/install.ts:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}