I’m trying to use loopj for making async HTTP requests. Works great, except when I try to access https site with self-signed cert. I get
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate.
I guess the default ssl options can be overriding using setSSLSocketFactory(SSLSocketFactory sslSocketFactory) method, but I’m not sure how to do it or it might not be the right way at all.
Please suggest how can I solve this issue ?
You do it almost exactly the same as explained here for HttpClient except a little bit simpler – Trusting all certificates using HttpClient over HTTPS
Create a custom class:
Then when you create your client instance: