How to programmatically add certificates to a truststore and use that also for verifying server authentication

前端 未结 2 884
无人及你
无人及你 2021-01-31 19:53

I my app I want to use a https connection to a user-specified server which uses a self-signed certificate. What I gathered by now is, that

  • self signed certificates
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-31 20:53

    You can use self-signed certificates. To use a self-signed certificate, you can convert it into bouncy castle format keystore which is supported by Android and then store it as a raw resource in your Android app project. How to convert and use it, all details can be found on Bob's blog. Here is the link for the same - http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html. This worked quite well. Hope this helps

提交回复
热议问题