private static SimpleHttpClientFactoryBean buildHttpClientFactoryBean(
            final CasSSLContext casSslContext,
            final LayeredConnectionSocketFactory trustStoreSslSocketFactory,
            final CasConfigurationProperties casProperties) {
            val client = new SimpleHttpClientFactoryBean.DefaultHttpClient();

            val httpClient = casProperties.getHttpClient();
            client.setConnectionTimeout(Beans.newDuration(httpClient.getConnectionTimeout()).toMillis());
            client.setSocketTimeout(Beans.newDuration(httpClient.getSocketTimeout()).toMillis());
            client.setResponseTimeout(Beans.newDuration(httpClient.getResponseTimeout()).toMillis());

            if (StringUtils.isNotBlank(httpClient.getProxyHost()) && httpClient.getProxyPort() > 0) {
                client.setProxy(new HttpHost(httpClient.getProxyHost(), httpClient.getProxyPort()));
            }
            client.setSslContext(casSslContext.getSslContext());
            client.setSslSocketFactory(trustStoreSslSocketFactory);
            client.setTrustManagers(casSslContext.getTrustManagers());

            val defaultHeaders = new ArrayList<Header>();
            httpClient.getDefaultHeaders().forEach((name, value) -> defaultHeaders.add(new BasicHeader(name, value)));
            client.setDefaultHeaders(defaultHeaders);

            return client;
        }
This is {@link CasCoreHttpConfiguration}.

@author Misagh Moayyed
@since 5.1.0
core/cas-server-core-web/src/main/java/org/apereo/cas/config/CasCoreHttpConfiguration.java