I try to connect to a server with a self-signed certificate. I use this code to accept all certificates.
public class CertificateAcceptor { public void
Have you tried calling setDefaultHostnameVerifier of HttpsURLConnection.
setDefaultHostnameVerifier
HttpsURLConnection
See this link for an example: Accepting a certificate for HTTPs on Android