{"record":{"id":"de940dd881e32c3c","repo":"diegosouzapw/OmniRoute","slug":"unable-to-compute-certificate-fingerprint-for-ce","errorCode":null,"errorMessage":"Unable to compute certificate fingerprint for ${certPath}","messagePattern":"Unable to compute certificate fingerprint for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mitm/cert/install.ts","lineNumber":111,"sourceCode":"        env: {\n          ...process.env,\n          CERT_NAME: \"OmniRoute MITM Root CA\",\n          CERT_PATH: certPath || \"\",\n          ACTION: action,\n        },\n      },\n      () => resolve()\n    );\n  });\n}\n\n// Get SHA1 fingerprint from cert file using Node.js crypto\nfunction getCertFingerprint(certPath: string): string {\n  const pem = fs.readFileSync(certPath, \"utf-8\");\n  const der = Buffer.from(pem.replace(/-----[^-]+-----/g, \"\").replace(/\\s/g, \"\"), \"base64\");\n  const pairs = crypto.createHash(\"sha1\").update(der).digest(\"hex\").toUpperCase().match(/.{2}/g);\n  if (!pairs) {\n    throw new Error(`Unable to compute certificate fingerprint for ${certPath}`);\n  }\n  return pairs.join(\":\");\n}\n\n/**\n * Check if certificate is already installed in system store\n */\nexport async function checkCertInstalled(certPath: string): Promise<boolean> {\n  if (IS_WIN) return checkCertInstalledWindows(certPath);\n  if (IS_MAC) return checkCertInstalledMac(certPath);\n  return checkCertInstalledLinux(certPath);\n}\n\n/**\n * macOS `security find-certificate -a -Z` prints the SHA-1 as a colon-less\n * hex string (e.g. `SHA-1 hash: ABCDEF…`), while {@link getCertFingerprint}\n * returns a colon-separated one (`AB:CD:EF…`). A raw substring check therefore\n * never matched and the cert was reported as not-installed on every run,","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/cert/install.ts#L93-L129","documentation":"Error \"Unable to compute certificate fingerprint for ${certPath}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/mitm/cert/install.ts:111 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"}