Reputation: 24739
I've been using Fiddler for a couple of weeks to test an API but we're moving to Postman.
Our APIs workflow is that a device must register by using a common cert and as a response to a successful registration a private cert is issued to that device. All requests the device makes after that uses the private cert.
I'm trying to test multiple devices which means I need Postman to use 5 or 6 certs for a single domain. In Fiddler I could modify the fiddlerscript so I had an array of all the certs I intended to use. If I wanted to switch certs I opened the script and used a different index of my cert array. I'd set oSession["https-Client-Certificate"]
and the request would use that cert.
In postman, I see that I can set a client cert for a particular domain. I've been able to get that to work for the global cert and running a /register request successfully. I can then change the cert and keep going. It's an annoying process if I want to change this cert after every request as I emulate multiple devices each with their own cert.
I see there's a Pre-Request Script tab. Is there a way to change the client cert in this script? If not with a Pre-Request Script, is there any other place where I can have multiple certs for a single domain and easily switch between them between requests?
Upvotes: 2
Views: 3116
Reputation: 5201
I don't think that's possible, but maybe you can trick it by updating your local hosts file by creating fake local domains
Then map each local domain in postman to each certificate
and create an environment for each certificate and update the url of each request to include the {{cert}} environment. Then by switching environments you should be switching the certificate at the same time.
Upvotes: 1