use of io.syndesis.qe.exceptions.RestClientException in project syndesis-qe by syndesisio.
the class RestUtils method createAllTrustingClient.
// Required in order to skip certificate validation
private static HttpClient createAllTrustingClient() throws RestClientException {
HttpClient httpclient = null;
try {
final SSLContextBuilder builder = new SSLContextBuilder();
builder.loadTrustMaterial((TrustStrategy) (X509Certificate[] chain, String authType) -> true);
final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build());
httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).setMaxConnTotal(1000).setMaxConnPerRoute(1000).build();
} catch (NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) {
throw new RestClientException("Cannot create all SSL certificates trusting client", e);
}
return httpclient;
}
Aggregations