private static CloseableHttpClient getHttpClient(final HttpExecutionRequest execution) throws Exception {
        val builder = getHttpClientBuilder(execution);
        if (StringUtils.isNotBlank(execution.getProxyUrl())) {
            val proxyEndpoint = new URI(execution.getProxyUrl()).toURL();
            val proxy = new HttpHost(proxyEndpoint.getHost(), proxyEndpoint.getPort());
            builder.setProxy(proxy);
        }
        return builder.build();
    }
Execute http request and produce a response.

@param execution the request
@return the http response
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/http/HttpUtils.java