No peer certificate
I've developed a small app that connect to my server using SSL with a self signed certificate. To make it work, i've loaded my certificate in a custom keystore using the BouncyCastleProvider, and imported the certificate in my custom SSLSocketFactory. Everythink works great from android 2.3 (minimum sdk) up to 4.4.4. But in android L (Preview) my app fails with:
Tue Aug 12 14:34:40 BRT 2014 : javax.net.ssl.SSLPeerUnverifiedException: No peer certificate at com.android.org.conscrypt.SSLNullSession.getPeerCertificates(SSLNullSession.java:104) at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93) at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:388) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) ....
and i have absolutely no idea how to fix it. Any help would be really appreciated.
Just to let you know how we fixed this issue in our project. Maybe this can help anybody.
We based our app on the ion and AndroidAsync network libs, which had this bug: https://github.com/koush/AndroidAsync/issues/187
An update to the newest version (1.4.0) fixed the "no peer certificate" issue for us on Android L.
链接地址: http://www.djcxy.com/p/31164.html上一篇: 没有同行证书
下一篇: 没有同行证书