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);	
Stop searching for code, let great code find you!  Add Codota to your java IDE