use of org.apereo.cas.configuration.model.core.authentication.HttpClientProperties in project cas by apereo.
the class CasCoreWebConfiguration method urlValidator.
@Bean
public FactoryBean<UrlValidator> urlValidator() {
final HttpClientProperties httpClient = this.casProperties.getHttpClient();
final boolean allowLocalLogoutUrls = httpClient.isAllowLocalLogoutUrls();
final String authorityValidationRegEx = httpClient.getAuthorityValidationRegEx();
final boolean authorityValidationRegExCaseSensitive = httpClient.isAuthorityValidationRegExCaseSensitive();
return new SimpleUrlValidatorFactoryBean(allowLocalLogoutUrls, authorityValidationRegEx, authorityValidationRegExCaseSensitive);
}
use of org.apereo.cas.configuration.model.core.authentication.HttpClientProperties in project cas by apereo.
the class CasCoreHttpConfiguration method httpClient.
@ConditionalOnMissingBean(name = "httpClient")
@Bean
public FactoryBean<SimpleHttpClient> httpClient() {
final SimpleHttpClientFactoryBean.DefaultHttpClient c = new SimpleHttpClientFactoryBean.DefaultHttpClient();
final HttpClientProperties httpClient = casProperties.getHttpClient();
c.setConnectionTimeout(Beans.newDuration(httpClient.getConnectionTimeout()).toMillis());
c.setReadTimeout((int) Beans.newDuration(httpClient.getReadTimeout()).toMillis());
return c;
}
use of org.apereo.cas.configuration.model.core.authentication.HttpClientProperties in project cas by apereo.
the class CasCoreHttpConfiguration method getHttpClient.
private HttpClient getHttpClient(final boolean redirectEnabled) throws Exception {
final SimpleHttpClientFactoryBean.DefaultHttpClient c = new SimpleHttpClientFactoryBean.DefaultHttpClient();
final HttpClientProperties httpClient = casProperties.getHttpClient();
c.setConnectionTimeout(Beans.newDuration(httpClient.getConnectionTimeout()).toMillis());
c.setReadTimeout((int) Beans.newDuration(httpClient.getReadTimeout()).toMillis());
c.setRedirectsEnabled(redirectEnabled);
c.setCircularRedirectsAllowed(redirectEnabled);
c.setSslSocketFactory(trustStoreSslSocketFactory());
c.setHostnameVerifier(hostnameVerifier());
return c.getObject();
}
Aggregations