code: public synchronized static SSLSocketFactory getTrustingSSLSocketFactory() {
          if (socketFactory != null) return socketFactory;
          TrustManager[] trustManagers = new TrustManager[] { new TrustEverythingSSLTrustManager() };
          SSLContext sc;
          try {
              sc = SSLContext.getInstance("SSL");
              sc.init(null, trustManagers, null);
          } catch (GeneralSecurityException e) {
              throw new RuntimeException("This is a BUG in Selenium; please report it", e);
          }
          socketFactory = sc.getSocketFactory();
          return socketFactory;
      }
docs: Returns an SSLSocketFactory that will trust all SSL certificates; this is suitable for passing to
  HttpsURLConnection, either to its instance method setSSLSocketFactory, or to its static method
  setDefaultSSLSocketFactory.
  @see javax.net.ssl.HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory)
  @see javax.net.ssl.HttpsURLConnection#setDefaultSSLSocketFactory(SSLSocketFactory)
  @return SSLSocketFactory suitable for passing to HttpsUrlConnection