【发布时间】:2013-01-11 09:27:56
【问题描述】:
我们的安卓应用程序引用HTTP URL 从服务器获取一些数据。直到 2 天前它工作正常,但突然我们得到"sslpeerunverifiedexception: no peer certificate" exception,而我们的代码和服务器都没有发生任何变化。代码很简单:
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, 12000);
HttpConnectionParams.setSoTimeout(httpParameters, 12000);
HttpClient client = new DefaultHttpClient(httpParameters);
HttpGet request = new HttpGet("http://site.com");
HttpResponse httpResponse = client.execute(request);
【问题讨论】:
-
请提供 logcat 详细信息。
-
1) URL 是 http 还是 https? 2) 本地主机还是直播网址?
-
我猜您的网址已更改为 https,为此您需要添加对等证书并设置主机名验证器等!
-
Androis 在 Galaxy Note II 上是 4.1.1。该 URL 是实时的,并且只有 HTTP。通过浏览器检查 URL 是否像以前一样工作
标签: android ssl httprequest