{"record":{"id":"a2810c2e9b8fbaea","repo":"usebruno/bruno","slug":"invalid-custom-ca-certificate-path-cacertfilepa","errorCode":null,"errorMessage":"Invalid custom CA certificate path: ${caCertFilePath}","messagePattern":"Invalid custom CA certificate path: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-requests/src/utils/ca-cert.ts","lineNumber":122,"sourceCode":"    let customCerts: string[] = [];\n    let nodeExtraCerts: string[] = [];\n\n    // handle user-provided custom CA certificate file with optional default certificates\n    if (caCertFilePath) {\n      // validate custom CA certificate file\n      if (fs.existsSync(caCertFilePath)) {\n        try {\n          const customCert = fs.readFileSync(caCertFilePath, 'utf8');\n          if (customCert && customCert.trim()) {\n            customCerts.push(customCert);\n            caCertificatesCount.custom = customCerts.length;\n          }\n        } catch (err) {\n          console.error(`Failed to read custom CA certificate from ${caCertFilePath}:`, (err as Error).message);\n          throw new Error(`Unable to load custom CA certificate: ${(err as Error).message}`);\n        }\n      } else {\n        throw new Error(`Invalid custom CA certificate path: ${caCertFilePath}`);\n      }\n\n      if (shouldKeepDefaultCerts) {\n        // get system certs\n        systemCerts = getSystemCerts();\n        caCertificatesCount.system = systemCerts.length;\n\n        // get root certs\n        rootCerts = [...tls.rootCertificates];\n        caCertificatesCount.root = rootCerts.length;\n      }\n    } else {\n      // get system certs\n      systemCerts = getSystemCerts();\n      caCertificatesCount.system = systemCerts.length;\n\n      // get root certs\n      rootCerts = [...tls.rootCertificates];","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-requests/src/utils/ca-cert.ts#L104-L140","documentation":"getCACertificates requires caCertFilePath to exist on disk; if fs.existsSync returns false it throws immediately, before any read attempt. Distinguishes a missing-path problem from a read problem.","triggerScenarios":"caCertFilePath is set to a path that does not exist on the filesystem (typo, relative path resolved against the wrong cwd, moved/deleted file, unmounted drive).","commonSituations":"User typed the path manually with a typo; path stored as relative but resolved against an unexpected working directory; collection moved machines and the absolute path no longer exists; environment variable for the cert path not set.","solutions":["Verify the path exists: fs.existsSync(caCertFilePath) before passing it in.","Use an absolute path and confirm it points to the actual cert file.","If the path is relative, resolve it against the collection directory or app data dir explicitly."],"exampleFix":"// before\n{ caCertFilePath: './certs/ca.pem' } // resolved against wrong cwd -> not found\n\n// after\n{ caCertFilePath: path.join(collectionPath, 'certs', 'ca.pem') }","handlingStrategy":"validation","validationCode":"import fs from 'node:fs';\nif (caCertFilePath && !fs.existsSync(caCertFilePath)) throw new Error(`Invalid custom CA certificate path: ${caCertFilePath}`);","typeGuard":"function isExistingPath(p): p is string { return typeof p === 'string' && !!p && fs.existsSync(p); }","tryCatchPattern":null,"preventionTips":["Use absolute paths for cert files.","Validate existence before configuring getCACertificates."],"tags":["tls","ca-cert","filesystem","missing-path"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}