public static void trustAllSSLCertificates ( HttpsURLConnection connection ) { getTrustingSSLSocketFactory ( ) ; connection . setSSLSocketFactory ( socketFactory ) ; connection . setHostnameVerifier ( new HostnameVerifier ( ) { public boolean verify ( String s , SSLSession sslSession ) { return true ; } } ) ; }
Configures a single HttpsURLConnection to trust all SSL certificates .