@Test
public void testCreateHostnameVerifier() throws Exception {

  ProxyCA proxyCA = new ProxyCA();
  proxyCA.init();
  HostnameVerifier verifier = proxyCA.getHostnameVerifier();
  SSLSession sslSession = Mockito.mock(SSLSession.class);
  Mockito.when(sslSession.getPeerCertificates()).thenReturn(
      KeyStoreTestUtil.bytesToKeyStore(
          proxyCA.createChildKeyStore(
              ApplicationId.newInstance(System.currentTimeMillis(), 1),
              "password"), "password").getCertificateChain("server"));
  Assert.assertTrue(verifier.verify("foo", sslSession));
}