Android 5.0 SSL Socket exception javax.net. ssl. SSLPeerUnverifiedException: No peer certificate, androidexception

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.