code: public SSLSocketFactory createSslSocketFactory() {
          try {
              SSLContext sslContext = SSLContext.getInstance("TLS");
              sslContext.init(null, new TrustManager[]{this}, null);
              return sslContext.getSocketFactory();
          } catch (NoSuchAlgorithmException | KeyManagementException e) {
              throw new AssertionError(e);
          }
      }
docs: Creates a new SSL socket factory that generates SSL sockets that trust all certificates unconditionally.
  
  @return A new SSL socket factory that generates SSL sockets that trust all certificates unconditionally.