{"record":{"id":"a3a726f617cd7f60","repo":"diegosouzapw/OmniRoute","slug":"user-canceled-authorization","errorCode":null,"errorMessage":"User canceled authorization","messagePattern":"User canceled authorization","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mitm/cert/install.ts","lineNumber":367,"sourceCode":"        \"-S\",\n        \"security\",\n        \"add-trusted-cert\",\n        \"-d\",\n        \"-r\",\n        \"trustRoot\",\n        \"-k\",\n        \"/Library/Keychains/System.keychain\",\n        certPath,\n      ],\n      sudoPassword\n    );\n    console.log(`✅ Installed certificate to system keychain: ${certPath}`);\n  } catch (error) {\n    const message = getErrorMessage(error);\n    const msg = message.includes(\"canceled\")\n      ? \"User canceled authorization\"\n      : \"Certificate install failed\";\n    throw new Error(msg);\n  }\n}\n\nasync function installCertLinux(sudoPassword: string, certPath: string): Promise<void> {\n  try {\n    const config = getLinuxCertConfig();\n    const destFile = `${config.dir}/${LINUX_CERT_NAME}`;\n\n    await execFileWithPassword(\"sudo\", [\"-S\", \"mkdir\", \"-p\", config.dir], sudoPassword);\n    await execFileWithPassword(\"sudo\", [\"-S\", \"cp\", certPath, destFile], sudoPassword);\n    // #9442: `cp` inherits the process umask. A restrictive umask (e.g. PM2\n    // UMask=0077) creates the system cert as 0600 root:root, unreadable by\n    // non-root TLS clients. Force the public cert to 0644 (world-readable).\n    await execFileWithPassword(\"sudo\", [\"-S\", \"chmod\", \"0644\", destFile], sudoPassword);\n    await execFileWithPassword(\"sudo\", [\"-S\", config.cmd], sudoPassword);\n\n    await updateNssDatabases(certPath, \"add\");\n  } catch (error) {","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/cert/install.ts#L349-L385","documentation":"Error \"User canceled authorization\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/mitm/cert/install.ts:367 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"}