Code example for SSLSocketFactory

Methods: setHostnameVerifier

0
		 */ 
	 
		if ((keyStore == null) || (trustStore == null))
			throw new Exception("[SOAPSenderImpl] keystore initialization missing");
		 
		SSLSocketFactory socketFactory = new SSLSocketFactory(SSLSocketFactory.TLS, // String algorithm
				keyStore, 					 // KeyStore keystore
				keyStoreParam.getPassword(), // String keystorePassword
				trustStore, 				 // KeyStore truststore
				null, 						 // SecureRandom random 
				null 						 // HostNameResolver nameResolver 
		); 
 
		// Hostname verification from certificate 
		// http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d4e506 
		socketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); // .STRICT_HOSTNAME_VERIFIER);
		return socketFactory;
			 
	} 
 
	/** 
Connect your IDE to all the code out there  Get Codota for Java