components/global/core/io.cellery.observability.api/src/main/java/io/cellery/observability/api/Utils.java
public static void disableSSLVerification() throws KeyManagementException, NoSuchAlgorithmException {
        TrustManager[] trustManagers = new TrustManager[]{new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return new X509Certificate[0];
            }

            public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
                // Do Nothing
            }

            public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
                // Do Nothing
            }
        }};
        SSLContext context = SSLContext.getInstance("TLS");
        context.init(null, trustManagers, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
        HttpsURLConnection.setDefaultHostnameVerifier((string, sslSession) -> true);
    }
/**
     * Disable SSL verification for the default URL connection.
     */
Disable SSL verification for the default URL connection.
Disable SSL verification for the default URL connection .
public static void disableSSLVerification() throws KeyManagementException, NoSuchAlgorithmException {
        TrustManager[] trustManagers = new TrustManager[]{new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return new X509Certificate[0];
            }
            public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
            }
            public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
            }
        }};
        SSLContext context = SSLContext.getInstance("TLS");
        context.init(null, trustManagers, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
        HttpsURLConnection.setDefaultHostnameVerifier((string, sslSession) -> true);
    }
public static void disableSSLVerification ( ) throws KeyManagementException , NoSuchAlgorithmException { TrustManager [ ] trustManagers = new TrustManager [ ] { new X509TrustManager ( ) { public X509Certificate [ ] getAcceptedIssuers ( ) { return new X509Certificate [ 0 ] ; } public void checkClientTrusted ( java . security . cert . X509Certificate [ ] certs , String authType ) { } public void checkServerTrusted ( java . security . cert . X509Certificate [ ] certs , String authType ) { } } } ; SSLContext context = SSLContext . getInstance ( "TLS" ) ; context . init ( null , trustManagers , new java . security . SecureRandom ( ) ) ; HttpsURLConnection . setDefaultSSLSocketFactory ( context . getSocketFactory ( ) ) ; HttpsURLConnection . setDefaultHostnameVerifier ( ( string , sslSession ) -> true ) ; }
Disable SSL verification for the default URL connection.
Disable SSL verification for the default URL connection .
// Do Nothing // Do Nothing