How do I avoid the “javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated” exception and the Android Apache lib gap “The constructor SSLSocketFactory(SSLContext) is undefined” in making an Https request?
How do I avoid the javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated exception and the Android Apache
Share
This method takes an HttpClient instance and returns a ready-for-https HttpClient instance.
Because the Android org.apache.http.conn.ssl.SSLSocketFactory does not have the SSLSocketFactory(SSLContext) constructor, I have extended the class as follows.
Excellent article here: http://javaskeleton.blogspot.com/2010/07/avoiding-peer-not-authenticated-with.html
And some help here: Trusting all certificates using HttpClient over HTTPS