title: Skip only hostname verification with Apache HttpClient
body: <p>I need to skip hostname verification with httpclient 4.2.1 without changing the trustmanager. I archived this like this:</p>
  
  <pre><code>    httpClient = new DefaultHttpClient(a, b);
      SSLSocketFactory socketFactory = (SSLSocketFactory) httpClient.getConnectionManager().getSchemeRegistry().get("https").getSchemeSocketFactory();
      socketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
  </code></pre>
  
  <p>... but setHostnameVerifier method i used is deprecated. How can i achieve the same thing with using not deprecated methods?</p>