1

I use Ktor with okhttp. My customer has a query which needs a Mutual TLS. I have the key and the pem certificate but I didn't manage to use them correctly. No problem with curl with this command: curl --key mykey.key --cert mycert.pem https://someurl.com/my-endpoint

I don't have a trust certificate or something like that.

Have you got an example in Kotlin please ?

Thanks

Coyado
  • 13
  • 2
  • You can configure SSL for an underlying OkHttp client https://ktor.io/docs/http-client-engines.html#okhttp. Answers to this question https://stackoverflow.com/questions/60224181/how-to-add-ssl-certificates-to-okhttp-mutual-tls-connection may be useful for you. – Aleksei Tirman Jun 26 '22 at 13:37
  • Hi. thanks for your answer. I found this ticket but I didn't manage to make it works. – Coyado Jun 26 '22 at 13:52
  • See also https://stackoverflow.com/questions/65283321/okhttp-mutual-ssl-in-android/65285588#65285588 – Jesse Wilson Jun 26 '22 at 15:00

0 Answers0