title: How to use Conscrypt with Apache HttpClient 5 to speed up TLS
body: <p>What is the recommended way to use Conscrypt with Apache HttpClient 5?</p>
  
  <p>I've tried adding the <code>conscrypt-openjdk-uber-2.2.1.jar</code> jar to my classpath and configuring my <code>sslcontext</code> as <code>SSLContexts.custom().setProvider(Conscrypt.newProvider())</code>, but when I test HttpClient with that <code>sslcontext</code> it throws: </p>
  
  <pre><code>[main] INFO org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec - 
  Recoverable I/O exception (java.net.NoRouteToHostException) caught when processing request to 
  {s}-&gt;https://www.wikipedia.org:443
  </code></pre>
  
  <p>If I remove the custom <code>setProvider</code> line then it works perfectly (via regular JSSE).</p>
  
  <p>I notice that Conscrypt is listed as a dependency here: <a href="https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/dependencies.html" rel="nofollow noreferrer">https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/dependencies.html</a>, so perhaps there is built-in support for Conscrypt that I need to enable somewhere?</p>