public HttpResponse execute(final HttpExecutionRequest execution) {
        val uri = buildHttpUri(execution.getUrl().trim(), execution.getParameters());
        val request = getHttpRequestByMethod(execution.getMethod().name().toLowerCase(Locale.ENGLISH).trim(), execution.getEntity(), uri);
        try {
            val expressionResolver = SpringExpressionLanguageValueResolver.getInstance();
            execution.getHeaders().forEach((key, value) -> {
                val headerValue = expressionResolver.resolve(value);
                val headerKey = expressionResolver.resolve(key);
                request.addHeader(headerKey, headerValue);
            });
            prepareHttpRequest(request, execution);
            val client = getHttpClient(execution);
            return FunctionUtils.doAndRetry(retryContext -> {
                LOGGER.trace("Sending HTTP request to [{}]. Attempt: [{}]", request.getUri(), retryContext.getRetryCount());
                val res = client.execute(request);
                if (res == null || org.springframework.http.HttpStatus.valueOf(res.getCode()).isError()) {
                    val maxAttempts = (Integer) retryContext.getAttribute("retry.maxAttempts");
                    if (maxAttempts == null || retryContext.getRetryCount() != maxAttempts - 1) {
                        throw new IllegalStateException();
                    }
                }
                return res;
            }, execution.getMaximumRetryAttempts());
        } catch (final SSLHandshakeException e) {
            val sanitizedUrl = FunctionUtils.doUnchecked(
                () -> new URIBuilder(execution.getUrl()).removeQuery().clearParameters().build().toASCIIString());
            LoggingUtils.error(LOGGER, "SSL error accessing: [" + sanitizedUrl + ']', e);
            return new BasicHttpResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, sanitizedUrl);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return null;
    }
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