agave-common/common-core/src/main/java/org/iplantc/service/common/clients/HTTPSClient.java
/**
	 * Creats a "trust everyone" HTTP client.
	 * @param escapedUri
	 * @return http client ready to be called with a HttpUriRequest
	 * @throws IOException
	 * @throws NoSuchAlgorithmException
	 * @throws KeyStoreException
	 * @throws KeyManagementException
	 */
Creats a "trust everyone" HTTP client.
Creats a " trust everyone " HTTP client .
private static CloseableHttpClient initClient(URI escapedUri) 
	throws IOException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException
	{
		CloseableHttpClient httpclient = null;
		if (escapedUri.getScheme().equalsIgnoreCase("https"))
		{
			SSLContextBuilder builder = new SSLContextBuilder();
		    builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
		    SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build(),
		    		SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
		    httpclient = HttpClients.custom()
		    		.setSSLSocketFactory(sslsf)
		    		.setRedirectStrategy(LaxRedirectStrategy.INSTANCE)
		    		.build();
		}
		else
		{
			httpclient = HttpClients.custom()
					.setRedirectStrategy(LaxRedirectStrategy.INSTANCE)
		    		.build();
		}
		return httpclient;
	}
private static CloseableHttpClient initClient ( URI escapedUri ) throws IOException , NoSuchAlgorithmException , KeyStoreException , KeyManagementException { CloseableHttpClient httpclient = null ; if ( escapedUri . getScheme ( ) . equalsIgnoreCase ( "https" ) ) { SSLContextBuilder builder = new SSLContextBuilder ( ) ; builder . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) ) ; SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory ( builder . build ( ) , SSLConnectionSocketFactory . ALLOW_ALL_HOSTNAME_VERIFIER ) ; httpclient = HttpClients . custom ( ) . setSSLSocketFactory ( sslsf ) . setRedirectStrategy ( LaxRedirectStrategy . INSTANCE ) . build ( ) ; } else { httpclient = HttpClients . custom ( ) . setRedirectStrategy ( LaxRedirectStrategy . INSTANCE ) . build ( ) ; } return httpclient ; }
Creats a "trust everyone" HTTP client.
Creats a " trust everyone " HTTP client .