Solving Connectivity Issue with Fiddler Classic When Using p12 Certificates in Postman

38 Views Asked by At

I use Postman to simulate accessing an API which requires a p12 certificate (with a password) for access.
After setting it up in Postman, I am able to access the API normally.

Now, I have opened Fiddler Classic, and when I try to access this API again, I encounter the following prompt.

fiddler's prompt

The server [***.***.***] requests a client certificate.
Please save a client certificate using the filename:

C:\Users\***\Documents\Fiddler2\ClientCertificate.cer

I followed GPT's advice and added specific code in Fiddler's OnBeforeRequest,

if (oSession.HostnameIs("YOUR_API_HOSTNAME")) {
    oSession["https-Client-Certificate"] = "C:\\path\\to\\your\\certificate.pfx:PASSWORD";
}

but I still encountered an error when sending requests in Postman.

Error: read ECONNRESET

How can I resolve this issue?

1

There are 1 best solutions below

0
Robert On

Seems like GPT had again some hallucination as the Fiddle Classic documentation never mentions that a password protected P12/PFX file can be directly used. The only way seems to be to import the certificate + key into your personal Windows certificate store and then point Fiddler to a .cer file that identifies the certificate to be used:

oSession["https-Client-Certificate"] = "C:\\test\\someCert.cer";

To generate a .CER file:

  1. Install the certificate in the Current User's Personal Certificate Store.
  2. Right-click the certificate in Personal Certificates Store.
  3. Click All Tasks > Export....

https://docs.telerik.com/fiddler/configure-fiddler/tasks/respondwithclientcert