title: HttpClient set up SSLHostnameVerifier and ConnectionManager at the same time
body: <pre><code>Registry&lt;ConnectionSocketFactory&gt; reg =RegistryBuilder&lt;ConnectionSocketFactory&gt;create().register("https", new  
  SSLConnectionSocketFactory(ctx)).register("http", new PlainConnectionSocketFactory())
              .build();
  
      PoolingHttpClientConnectionManager cm = newPoolingHttpClientConnectionManager(reg);
  
      client = HttpClients.custom()
              .setConnectionManager(cm)
              .setDefaultRequestConfig(config)
              .setSSLHostnameVerifier(new NoopHostnameVerifier())
              .build();
  </code></pre>
  
  <p>I use NoopHostnameVerifier because I do not want to verify SSL, but in my ConnectionManager exists essential logic and have not chances forgot ConnectionManager.</p>
  
  <p>The problem is that if I have ConnectionManager and SSLHostnameVerifier(NoopHostnameVerifier), I get the following error:</p>
  
  <blockquote>
    <p>javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated</p>
  </blockquote>
  
  <p>What might be causing this problem?</p>