@Disabled("connecting to the outside world makes this test flaky")
@Test
public void testCommonClientUsesExtensibleTrustManager() throws Exception {

    ArgumentCaptor<X509Certificate[]> certificateChainCaptor = ArgumentCaptor.forClass(X509Certificate[].class);
    ArgumentCaptor<SSLEngine> sslEngineCaptor = ArgumentCaptor.forClass(SSLEngine.class);
    HttpClient httpClient = webClientFactory.getCommonHttpClient();
    ContentResponse response = httpClient.GET(TEST_URL);
    if (response.getStatus() != 200) {
        fail("Statuscode != 200");
    }
    verify(extensibleTrustManager).checkServerTrusted(certificateChainCaptor.capture(), anyString(),
            sslEngineCaptor.capture());
    verifyNoMoreInteractions(extensibleTrustManager);
    assertThat(sslEngineCaptor.getValue().getPeerHost(), is("www.eclipse.org"));
    assertThat(sslEngineCaptor.getValue().getPeerPort(), is(443));
    assertThat(certificateChainCaptor.getValue()[0].getSubjectX500Principal().getName(),
            containsString("eclipse.org"));
}