public static URLConnectionFactory newDefaultURLConnectionFactory(
      Configuration conf) {
    ConnectionConfigurator conn = getSSLConnectionConfiguration(
        DEFAULT_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT, conf);

    return new URLConnectionFactory(conn);
  }
@Test
  public void testSSLInitFailure() throws Exception {
    Configuration conf = new Configuration();
    conf.set(SSLFactory.SSL_HOSTNAME_VERIFIER_KEY, "foo");
    GenericTestUtils.LogCapturer logs =
        GenericTestUtils.LogCapturer.captureLogs(
            LoggerFactory.getLogger(URLConnectionFactory.class));
    URLConnectionFactory.newDefaultURLConnectionFactory(conf);
    Assert.assertTrue("Expected log for ssl init failure not found!",
        logs.getOutput().contains(
        "Cannot load customized ssl related configuration"));
  }