Android 5.0 SSL Socket exception javax.net. ssl. SSLPeerUnverifiedException: No peer certificate, androidexception
Update android 5.0 to the latest version to test my app. When I use the api to call Https access, the following error is reported.
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate 11-26 15:35:01.919: W/System.err(353): at com.android.org.conscrypt.SSLNullSession.getPeerCertificates(SSLNullSession.java:104)11-26 15:35:01.919: W/System.err(353): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)11-26 15:35:01.919: W/System.err(353): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:388)11-26 15:35:01.919: W/System.err(353): at org.apache.http.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:231)11-26 15:35:01.919: W/System.err(353): at org.apache.http.impl.conn.AbstractPoolEntry.layerProtocol(AbstractPoolEntry.java:302)11-26 15:35:01.920: W/System.err(353): at org.apache.http.impl.conn.AbstractPooledConnAdapter.layerProtocol(AbstractPooledConnAdapter.java:146)11-26 15:35:01.920: W/System.err(353): at org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:654)11-26 15:35:01.920: W/System.err(353): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:370)11-26 15:35:01.920: W/System.err(353): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)11-26 15:35:01.920: W/System.err(353): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)11-26 15:35:01.920: W/System.err(353): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)11-26 15:35:01.920: W/System.err(353): at com.praxify.model.CallServer.makeHttpGetRequest(CallServer.java:1515)android apache ssl ssl-certificate
These two days have been plagued by this problem. After unremitting efforts, I have finally located the problem (not necessarily the perfect solution for general purposes .)
In android 5.0, Google does not trust the SHA1 certificate, even if it is set to expire on January 1, 2016. If you find the above problems, you can check whether the certificate problem is solved through the browser connection. The solution is very simple. You only need to reconfigure the SHA256 or SHA1 certificate to generate a new one. the expiration date can be set to January 1, 2015.
I am here to find the address of the solution, good English can see the original: https://code.google.com/p/android-developer-preview/issues/detail? Id = 1200
Address: http://www.itmmd.com/201412/239.html
By mengmeng IT people