HTTPS使用自签名证书问题?解决方案或更好的办法? [英] HTTPS with Self-Signed SSL Certificate Issues... Solution or better way?

查看:232
本文介绍了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 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解决方案: <一个href="http://stackoverflow.com/questions/995514/https-connection-android">http://stackoverflow.com/questions/995514/https-connection-android

HttpClient的解决方案: <一个href="http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android">http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android

这篇关于HTTPS使用自签名证书问题?解决方案或更好的办法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆