use of io.fabric8.utils.ssl.TrustEverythingSSLTrustManager in project fabric8 by fabric8io.
the class WebClients method disableSslChecks.
public static void disableSslChecks(WebClient webClient) {
HTTPConduit conduit = WebClient.getConfig(webClient).getHttpConduit();
TLSClientParameters params = conduit.getTlsClientParameters();
if (params == null) {
params = new TLSClientParameters();
conduit.setTlsClientParameters(params);
}
params.setTrustManagers(new TrustManager[] { new TrustEverythingSSLTrustManager() });
params.setDisableCNCheck(true);
}
use of io.fabric8.utils.ssl.TrustEverythingSSLTrustManager in project fabric8 by fabric8io.
the class GitUtils method disableSslCertificateChecks.
public static void disableSslCertificateChecks() {
LOG.info("Trusting all SSL certificates");
try {
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, new TrustManager[] { new TrustEverythingSSLTrustManager() }, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
// bypass host name check, too.
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
} catch (NoSuchAlgorithmException e) {
LOG.warn("Failed to bypass certificate check", e);
} catch (KeyManagementException e) {
LOG.warn("Failed to bypass certificate check", e);
}
}
Aggregations