HTTPS使用自签名证书问题?解决方案或更好的办法?证书、解决方案、办法、问题

由网友(安然浅笑)分享简介:所有我需要做的是从具有自签名证书的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 cert...

所有我需要做的是从具有自签名证书的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.

有没有更好的方式来执行这些文件下载?也许通过web视图或浏览器的功能?重塑制作一个简单的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解决方案: http://stackoverflow.com/questions/995514/https-connection-android

HttpClient的解决方案: http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android

阅读全文

相关推荐

最新文章