Code example for SSLSocketFactory

Methods: setHostnameVerifier

0
	        	} 
	        } 
//	        enumerateCertificates(systemTrusted); 
	         
	        // Create sockets with keyStores 
	        SSLSocketFactory sf = new SSLSocketFactory(systemTrusted);
	        SSLSocketFactory sf1 = new SSLSocketFactory(customTrusted);
	         
	        // Set type of verification host name		 
	        sf.setHostnameVerifier(sslsocket);														
	        sf1.setHostnameVerifier(sslsocket);
	         
	        // 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);