Search in sources :

Example 6 with HttpClient

use of org.apereo.cas.util.http.HttpClient in project cas by apereo.

the class FileTrustStoreSslSocketFactoryTests method verifyTrustStoreLoadingSuccessfullyWihInsecureEndpoint.

@Test
public void verifyTrustStoreLoadingSuccessfullyWihInsecureEndpoint() {
    final SimpleHttpClientFactoryBean clientFactory = new SimpleHttpClientFactoryBean();
    clientFactory.setSslSocketFactory(sslFactory());
    final HttpClient client = clientFactory.getObject();
    assertTrue(client.isValidEndPoint("http://wikipedia.org"));
}
Also used : SimpleHttpClientFactoryBean(org.apereo.cas.util.http.SimpleHttpClientFactoryBean) HttpClient(org.apereo.cas.util.http.HttpClient) Test(org.junit.Test)

Example 7 with HttpClient

use of org.apereo.cas.util.http.HttpClient in project cas by apereo.

the class FileTrustStoreSslSocketFactoryTests method verifyTrustStoreLoadingSuccessfullyForValidEndpointWithNoCert.

@Test
public void verifyTrustStoreLoadingSuccessfullyForValidEndpointWithNoCert() {
    final SimpleHttpClientFactoryBean clientFactory = new SimpleHttpClientFactoryBean();
    clientFactory.setSslSocketFactory(sslFactory());
    final HttpClient client = clientFactory.getObject();
    assertTrue(client.isValidEndPoint("https://www.google.com"));
}
Also used : SimpleHttpClientFactoryBean(org.apereo.cas.util.http.SimpleHttpClientFactoryBean) HttpClient(org.apereo.cas.util.http.HttpClient) Test(org.junit.Test)

Aggregations

HttpClient (org.apereo.cas.util.http.HttpClient)7 SimpleHttpClientFactoryBean (org.apereo.cas.util.http.SimpleHttpClientFactoryBean)5 Test (org.junit.Test)5 URL (java.net.URL)1 List (java.util.List)1 Slf4j (lombok.extern.slf4j.Slf4j)1 StringUtils (org.apache.commons.lang3.StringUtils)1 URIBuilder (org.apache.http.client.utils.URIBuilder)1 BasicDuoSecurityAuthenticationService (org.apereo.cas.adaptors.duo.authn.BasicDuoSecurityAuthenticationService)1 DefaultDuoMultifactorAuthenticationProvider (org.apereo.cas.adaptors.duo.authn.DefaultDuoMultifactorAuthenticationProvider)1 DuoAuthenticationHandler (org.apereo.cas.adaptors.duo.authn.DuoAuthenticationHandler)1 DuoCredential (org.apereo.cas.adaptors.duo.authn.DuoCredential)1 DuoDirectCredential (org.apereo.cas.adaptors.duo.authn.DuoDirectCredential)1 DetermineDuoUserAccountAction (org.apereo.cas.adaptors.duo.web.flow.action.DetermineDuoUserAccountAction)1 PrepareDuoWebLoginFormAction (org.apereo.cas.adaptors.duo.web.flow.action.PrepareDuoWebLoginFormAction)1 DuoMultifactorWebflowConfigurer (org.apereo.cas.adaptors.duo.web.flow.config.DuoMultifactorWebflowConfigurer)1 AuthenticationEventExecutionPlanConfigurer (org.apereo.cas.authentication.AuthenticationEventExecutionPlanConfigurer)1 AuthenticationHandler (org.apereo.cas.authentication.AuthenticationHandler)1 AuthenticationMetaDataPopulator (org.apereo.cas.authentication.AuthenticationMetaDataPopulator)1 ByCredentialTypeAuthenticationHandlerResolver (org.apereo.cas.authentication.ByCredentialTypeAuthenticationHandlerResolver)1