HTTPS 与自签名 SSL 证书问题...解决方案还是更好的方法?
我需要做的就是从具有自签名 SSL 证书的 Web 服务器下载一些基本的基于文本和图像文件。
我一直试图弄清楚如何使用 HttpClient 来做到这一点,但是让 SSL 工作是一场噩梦,对于这样一个简单的任务来说似乎太麻烦了。
有没有更好的方法来执行这些文件下载?也许通过 WebView 或浏览器功能?重新发明一个简单的 HTTPS GET 请求是一件很痛苦的事情,并且严重拖延了我的开发进度。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了两个关于如何接受自签名 SSL 证书的绝佳示例,HttpsURLConnection 和 HttpClient 各一个。
HttpsURLConnection解决方案: Https Connection Android
HttpClient解决方案: Android 上的自签名 SSL 接受
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