Code example for HttpsURLConnection

Methods: setHostnameVerifier

0
					.setDefaultSSLSocketFactory(sc.getSocketFactory()); 
		} catch (Exception e) { 
			e.printStackTrace(); 
		} 
		HttpsURLConnection https = (HttpsURLConnection) url.openConnection(); 
	    https.setHostnameVerifier(new HostnameVerifier() { 
			public boolean verify(String hostname, SSLSession session) {
				return true; 
			} 
		}); 
	    return https; 
	} 
	 
 
}