@Test
  public void testSecureConnectionOnInsecureHttpsServer()
      throws IOException, InterruptedException, GeneralSecurityException, URISyntaxException {
    FailoverHttpClient secureHttpClient =
        new FailoverHttpClient(false /*secure*/, false, logger, false);
    try (TestWebServer server = new TestWebServer(true);
        Response ignored = secureHttpClient.get(new URL(server.getEndpoint()), request)) {
      Assert.fail("Should fail if cannot verify peer");

    } catch (SSLException ex) {
      Assert.assertNotNull(ex.getMessage());
    }
  }
Tests for {@link FailoverHttpClient} using an actual local server.
jib-core/src/test/java/com/google/cloud/tools/jib/http/WithServerFailoverHttpClientTest.java