{"record":{"id":"05a392d23362662f","repo":"usebruno/bruno","slug":"pfxfilepath-is-required-for-pfx-type","errorCode":null,"errorMessage":"pfxFilePath is required for pfx type","messagePattern":"pfxFilePath is required for pfx type","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-requests/src/utils/http-https-agents.ts","lineNumber":303,"sourceCode":"            }\n            certFilePath = path.isAbsolute(certFilePath) ? certFilePath : path.join(collectionPath, certFilePath);\n            let keyFilePath = clientCert?.keyFilePath;\n            if (!keyFilePath) {\n              throw new Error('keyFilePath is required for cert type');\n            }\n            keyFilePath = path.isAbsolute(keyFilePath) ? keyFilePath : path.join(collectionPath, keyFilePath);\n\n            certsConfig.cert = fs.readFileSync(certFilePath);\n            certsConfig.key = fs.readFileSync(keyFilePath);\n          } catch (err: any) {\n            console.error('Error reading cert/key file', err);\n            throw new Error(`Error reading cert/key file: ${err.message}`);\n          }\n        } else if (type === 'pfx') {\n          try {\n            let pfxFilePath = clientCert?.pfxFilePath;\n            if (!pfxFilePath) {\n              throw new Error('pfxFilePath is required for pfx type');\n            }\n            pfxFilePath = path.isAbsolute(pfxFilePath) ? pfxFilePath : path.join(collectionPath, pfxFilePath);\n            certsConfig.pfx = fs.readFileSync(pfxFilePath);\n          } catch (err: any) {\n            console.error('Error reading pfx file', err);\n            throw new Error(`Error reading pfx file: ${err.message}`);\n          }\n        }\n        certsConfig.passphrase = clientCert.passphrase;\n        break;\n      }\n    }\n  }\n\n  /**\n   * Proxy configuration\n   *\n   * Preferences proxyMode has four possible values: on, off, system, pac","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-requests/src/utils/http-https-agents.ts#L285-L321","documentation":"When a client-cert entry has type 'pfx', the loader requires clientCert.pfxFilePath to be set; a falsy value throws before any read.","triggerScenarios":"A clientCertificates entry matches the request domain, is enabled, type is 'pfx', but pfxFilePath is empty/undefined.","commonSituations":"User switched the entry type to 'pfx' but did not select the .pfx/.p12 file; config hand-edited and the key dropped; import from a schema that named the field differently.","solutions":["Select a .pfx/.p12 file for the entry.","Populate pfxFilePath in the stored config.","Disable the entry until the pfx file is available."],"exampleFix":"// before\n{ domain:'api.example.com', type:'pfx', passphrase:'pw' } // no pfxFilePath\n\n// after\n{ domain:'api.example.com', type:'pfx', pfxFilePath:'/c.pfx', passphrase:'pw' }","handlingStrategy":"validation","validationCode":"for (const cc of clientCertificates?.certs ?? []) {\n  if (!cc.disabled && cc.type === 'pfx' && !cc.pfxFilePath) throw new Error(`pfxFilePath missing for domain ${cc.domain}`);\n}","typeGuard":"function isValidPfxEntry(c): boolean { return c?.type === 'pfx' ? !!c?.pfxFilePath : true; }","tryCatchPattern":null,"preventionTips":["When switching an entry to type 'pfx', always select the .pfx file.","Disable incomplete pfx entries."],"tags":["tls","client-cert","pfx","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}