usebruno/bruno · error · Error

Error reading pfx file

Error message

Error reading pfx file

What it means

Error "Error reading pfx file" thrown in usebruno/bruno.

Source

Thrown at packages/bruno-electron/src/ipc/network/cert-utils.js:104

            let certFilePath = interpolateString(clientCert?.certFilePath, interpolationOptions);
            certFilePath = path.isAbsolute(certFilePath) ? certFilePath : path.join(collectionPath, certFilePath);
            let keyFilePath = interpolateString(clientCert?.keyFilePath, interpolationOptions);
            keyFilePath = path.isAbsolute(keyFilePath) ? keyFilePath : path.join(collectionPath, keyFilePath);

            httpsAgentRequestFields['cert'] = fs.readFileSync(certFilePath);
            httpsAgentRequestFields['key'] = fs.readFileSync(keyFilePath);
          } catch (err) {
            console.error('Error reading cert/key file', err);
            throw new Error('Error reading cert/key file' + err);
          }
        } else if (type === 'pfx') {
          try {
            let pfxFilePath = interpolateString(clientCert?.pfxFilePath, interpolationOptions);
            pfxFilePath = path.isAbsolute(pfxFilePath) ? pfxFilePath : path.join(collectionPath, pfxFilePath);
            httpsAgentRequestFields['pfx'] = fs.readFileSync(pfxFilePath);
          } catch (err) {
            console.error('Error reading pfx file', err);
            throw new Error('Error reading pfx file' + err);
          }
        }
        httpsAgentRequestFields['passphrase'] = interpolateString(clientCert.passphrase, interpolationOptions);
        break;
      }
    }
  }

  /**
   * Proxy configuration
   *
   * New format:
   * - disabled: boolean (optional, defaults to false)
   * - inherit: boolean (required)
   * - config: { protocol, hostname, port, auth, bypassProxy }
   *
   * When collection proxy has inherit=false and disabled=false, use collection-specific proxy
   * When collection proxy has inherit=true, inherit from global preferences

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Verify the pfx file path is correct and readable.
  2. Check the file is a valid PKCS#12 bundle and not corrupted.

When it happens

Trigger: Thrown at packages/bruno-electron/src/ipc/network/cert-utils.js:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/90c0c5fca3968114. Report an issue: GitHub.