HTTPS与自签名SSL证书问题...解决方案或更好的方式? [英] HTTPS with Self-Signed SSL Certificate Issues... Solution or better way?
问题描述
所有我需要做的是从具有自签名SSL证书的Web服务器下载一些基本的基于文本和图像文件。
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.
我一直在尝试要弄清楚如何使用HttpClient来做到这一点,但让SSL工作是一个噩梦,似乎对于这样一个简单的任务来说太麻烦了。
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.
是有更好的方式来执行这些文件下载?也许通过WebView或浏览器功能?重新制定简单的HTTPS GET请求是一个重大的痛苦,并且显着地阻碍了我的开发进度。
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.
推荐答案
发现了两个很好的例子,说明如何接受自签名SSL证书,一个是HttpsURLConnection和HttpClient。
I found two great examples of how to accept self-signed SSL certificates, one each for HttpsURLConnection and HttpClient.
HttpsURLConnection解决方案: 连接Android
HttpClient解决方案: strong> Android上的自签名SSL验证
这篇关于HTTPS与自签名SSL证书问题...解决方案或更好的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!