HTTPS with Self-Signed SSL Certificate Issues… Solution or better way?

…衆ロ難τιáo~ 提交于 2019-11-27 00:31:20

问题


All I need to do is download some basic text-based and image files from a web server that has a self-signed SSL certificate.

I have been trying to figure out how to use HttpClient to do this, but getting the SSL to work is a nightmare that seems to be way too much trouble for such a simple task.

Is there a better way to perform these file downloads? Perhaps through a WebView or Browser feature? Reinventing the wheel of making a simple HTTPS GET request is a major pain, and is significantly holding up my development schedule.


回答1:


I found two great examples of how to accept self-signed SSL certificates, one each for HttpsURLConnection and HttpClient.

HttpsURLConnection solution: Https Connection Android

HttpClient solution: Self-signed SSL acceptance on Android



来源:https://stackoverflow.com/questions/2740975/https-with-self-signed-ssl-certificate-issues-solution-or-better-way

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!