Javax.net.ssl.SSLPeerUnverifiedException, No Peer Certificate Found Android

This Article will let you know how to bypass SSL issue in your Android Development. Sometimes it happens when we face issues related to SSL in Android 4.4 or less. And we don’t want to embed our SSL certificate with Android App, In that case, this trick helps us.  While dealing with javax.net.ssl.SSLPeerUnverifiedException error in Android development has sent me to a wild good chase. But now I have found the best solution to get rid of this kind of problems like SSL certificate is invalid, No peer certificate found etc. I’m sharing the solution what I have implemented in my code.

To go beyond the SSL problem in Android development you need to do some extra efforts. So start with this just Override some predefined methods & Classes. Now we are going to create a custom Socket Factory for HTTP Client.
First of all, create a class named SimpleSSLSocketFactory.java :

SimpleSSLSocketFactory.java :

Now you have to use this Class as your default Httpclient. Create below-mentioned method in your connection class: or implement this as you need.

Now Finally done! you are able to use any HTTPS site response on your mobile device code. No SSL Error, No Peer certificate Error etc. Enjoy !!

I’m Dipendra, software developer, and designer who has written code in many of the language known to mankind.Passionate about Technology. In my free time, I love to write articles and build the code.

Leave a reply:

Your email address will not be published.

Site Footer