code: protected static org.apache.http.client.HttpClient buildHttpClient(boolean contentCompression, boolean sslVerification) {
          RequestConfig rc = RequestConfig.custom()
                  .setCookieSpec(CookieSpecs.STANDARD)
                  .build();
  
          HttpClientBuilder builder = HttpClients.custom()
                  .useSystemProperties();
  
          if (!contentCompression) {
              builder.disableContentCompression();
          }
  
          if (!sslVerification) {
              try {
                  builder.setSSLSocketFactory(generateAllTrustingSSLConnectionSocketFactory());
              } catch (Exception e) {
                  throw new RuntimeException("Unable to create all-trusting SSLConnectionSocketFactory", e);
              }
  
          }
  
          return builder.setConnectionReuseStrategy(NoConnectionReuseStrategy.INSTANCE)
                  .setUserAgent(HttpClient.class.getName())
                  .setDefaultRequestConfig(rc)
                  .build();
      }
docs: Builds an apache HttpClient instance
  @param contentCompression if true, the returned instance will support content compression
  @return an apache HttpClient instance