1.时间
一些老手机不是系统自动对时,时间错误会报错。
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:
2.httpclient
错误:
javax.net.ssl.SSLException:hostname in certificate didn't match:<**.**.****.com> != <*.****.com>
解决办法:
SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext,SSLConnectionSocktFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
参考
https://www.jianshu.com/p/c164e92d9705