Code example for SSLSocketFactory

Methods: setHostnameVerifier

//	        enumerateCertificates(systemTrusted); 
	        // Create sockets with keyStores 
	        SSLSocketFactory sf = new SSLSocketFactory(systemTrusted);
	        SSLSocketFactory sf1 = new SSLSocketFactory(customTrusted);
	        // Set type of verification host name		 
	        // Create scheme with http and https protocols 
	        SchemeRegistry registry = new SchemeRegistry();			
	        registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
	        registry.register(new Scheme("https", sf, 443));
	        registry.register(new Scheme("https", sf1, 443));
	        // Create connection manager 
	        ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(params, registry);	
Connect your IDE to all the code out there  Get Codota for Java