code: public static void disableSSLValidation() {
      try {
        SSLContext context = SSLContext.getInstance("SSL");
        context.init(null, new TrustManager[]{new UnsafeTrustManager()}, null);
        HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
docs: Disabling SSL validation is strongly discouraged. This is generally only intended for use during testing or perhaps
  when used in a private network with a self signed certificate.
  
  <p>Even when using with a self signed certificate it is recommended that instead of disabling SSL validation you
  instead add your self signed certificate to the Java keystore.</p>