How do I avoid getting “No peer certificate” error when connecting to this HTTPS site on Android?

前端 未结 3 1061
遇见更好的自我
遇见更好的自我 2020-12-10 07:55

I am developing an Android application which needs to access QuickPay\'s service (\"https://secure.quickpay.dk/form\") through an Http-client. But I keep getting errors whe

相关标签:
3条回答
  • 2020-12-10 08:05

    Try using UrlConnection class to make connections, and see whether you can avoid this "no peer certificate" error.

    0 讨论(0)
  • 2020-12-10 08:11

    This is very mysterious. The only way an HTTPS/SSL server can avoid sending a certificate is if both sides agree to operate the SSL connection in reverse, where the server is the SSL client and the client is the SSL server, so the certificate travels in the other direction. But I can't see anything in your code that enables that mode, and it would have to be enabled at the other end too. And you would have to be providing a certificate yourself from your keystore ... Very strange.

    0 讨论(0)
  • 2020-12-10 08:15

    Just to sum up, I fixed this issue by sticking to the WebView approach. The interaction with the API was moved to a server, creating an intermediate communication point which handles the certificate issues. Not the most elegant solution but it works :)

    0 讨论(0)
提交回复
热议问题