Android javax.net.ssl.SSLPeerUnverifiedException: No peer certificate

写Android代码, 使用Https请求, 出现以下错误… 按照网上的答案, 都无法解决问题.

01-15 11:55:39.220 18438-18459/cn.deardaisy.daisy W/System.err﹕ javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
01-15 11:55:39.220 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:137)
01-15 11:55:39.220 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
01-15 11:55:39.220 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:147)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:178)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:109)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.loopj.android.http.SyncHttpClient.sendRequest(SyncHttpClient.java:95)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:942)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.avos.avoscloud.RequestStatisticsUtil.sendData(RequestStatisticsUtil.java:118)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.avos.avoscloud.RequestStatisticsUtil.sendToServer(RequestStatisticsUtil.java:70)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at com.avos.avoscloud.ArchiveRequestTaskController 1.run(ArchiveRequestTaskController.java:45)011511:55:39.2301843818459/cn.deardaisy.daisyW/System.erratjava.util.concurrent.Executors RunnableAdapter.call(Executors.java:442)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at java.util.concurrent.FutureTask Sync.innerRun(FutureTask.java:305)011511:55:39.2301843818459/cn.deardaisy.daisyW/System.erratjava.util.concurrent.FutureTask.run(FutureTask.java:137)011511:55:39.2301843818459/cn.deardaisy.daisyW/System.erratjava.util.concurrent.ScheduledThreadPoolExecutor ScheduledFutureTask.access 201(ScheduledThreadPoolExecutor.java:150)011511:55:39.2301843818459/cn.deardaisy.daisyW/System.erratjava.util.concurrent.ScheduledThreadPoolExecutor ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-15 11:55:39.230 18438-18459/cn.deardaisy.daisy W/System.err﹕ at java.lang.Thread.run(Thread.java:856)

出现这样的错误无法获取网络的数据, 我郁闷了很久, 因为有两个手机测试, 一个不会出现这样的错误, 另一个会, 纠结着, 突然间,我注意到…. 时间不对, 出问题那个手机时间乱了, 没有和网络同步, 打开手机的时间同步, 把时间设置好, 然后.. 就不会出现这样的问题了.好诡异啊

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值