0

I have to send a request to a specific endpoint via Ktor. I have tested the endpoint using Postman and it works fine.

In Postman, before sending the request I have to add a client certificate by:

  1. Mentioning Host and Port number
  2. Attaching PFX file (which I already have)
  3. Specifying the passphrase

How do I do the same in Ktor (OkHttp Engine)? I tried configuring the engine settings by following the instructions in this link, but it does not ask for the host and port, and I do not know how to attach the PFX file to the keystore.

Anchith Acharya
  • 369
  • 1
  • 4
  • 16
  • 1
    The SSL configuration is applied to a whole client instance so you can create a separate HTTP client to make requests only to specific endpoints. Here https://stackoverflow.com/a/4714112/13963150 you can find information about how to import a PFX file into a keystore. – Aleksei Tirman Oct 13 '22 at 07:41

0 Answers0