关于Android Https网络连接失败 我遇到最扯的一个问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于Android Https网络连接失败 我遇到最扯的一个问题相关的知识,希望对你有一定的参考价值。

com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Sun Jan 01 23:02:24 GMT+08:00 2012, validation time: Wed Nov 06 05:36:50 GMT+08:00 2013
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)
Caused by: javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Sun Jan 01 23:02:24 GMT+08:00 2012, validation time: Wed Nov 06 05:36:50 GMT+08:00 2013
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:401)
at libcore.net.http.HttpConnection.setupSecureSocket(HttpConnection.java:209)
at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:478)
at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:433)
at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:282)
at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:96)
... 1 more
Caused by: java.security.cert.CertificateException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Sun Jan 01 23:02:24 GMT+08:00 2012, validation time: Wed Nov 06 05:36:50 GMT+08:00 2013
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:308)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:202)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:608)
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:398)
... 11 more
Caused by: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Sun Jan 01 23:02:24 GMT+08:00 2012, validation time: Wed Nov 06 05:36:50 GMT+08:00 2013
at com.android.org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(RFC3280CertPathUtilities.java:1492)
at com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:305)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:190)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:295)
... 15 more
Caused by: java.security.cert.CertificateNotYetValidException: current time: Sun Jan 01 23:02:24 GMT+08:00 2012, validation time: Wed Nov 06 05:36:50 GMT+08:00 2013
at org.apache.harmony.security.provider.cert.X509CertImpl.checkValidity(X509CertImpl.java:144)
at org.apache.harmony.security.provider.cert.X509CertImpl.checkValidity(X509CertImpl.java:138)
at com.android.org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(RFC3280CertPathUtilities.java:1483)
... 18 more

 

问题手机 三星 安卓版本4.3

解决办法:

将手机系统时间和网络时间同步就好了

同步后弹出的通知不要太多……

以上是关于关于Android Https网络连接失败 我遇到最扯的一个问题的主要内容,如果未能解决你的问题,请参考以下文章

Android WebRTC低成功连接率

Android连接WebService失败,帮我看看是啥原因

在 Android 中检测有限的网络连接?

使用 HTTPS 协议的 android 连接中的 Socket.io 客户端失败?

网络请求失败对 https 图像上传 Android 做出本机反应

489次成功连接后android蓝牙连接失败