[java-identity-provider] branch main updated: JSSH-16: Update to Apache HttpClient 5.x
Brent Putman
putmanb at georgetown.edu
Tue Feb 21 19:31:44 UTC 2023
This is an automated email from the git hooks/post-receive script.
putmanb pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=0570655cd705e1479f86aa3d8e825418939c558d
The following commit(s) were added to refs/heads/main by this push:
new 0570655cd JSSH-16: Update to Apache HttpClient 5.x
0570655cd is described below
commit 0570655cd705e1479f86aa3d8e825418939c558d
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Thu Feb 2 23:43:10 2023 -0500
JSSH-16: Update to Apache HttpClient 5.x
Initial refactor.
---
idp-admin-api/pom.xml | 9 ++---
.../shibboleth/idp/module/AbstractIdPModule.java | 16 ++++----
.../java/net/shibboleth/idp/module/IdPModule.java | 2 -
.../net/shibboleth/idp/module/ModuleContext.java | 2 +-
idp-authn-impl/pom.xml | 9 +++--
.../authn/duo/impl/AbstractDuoAuthenticator.java | 23 ++++++-----
.../idp/authn/duo/impl/DuoAuthAuthenticator.java | 12 +++---
.../authn/duo/impl/DuoPreauthAuthenticator.java | 14 +++----
.../shibboleth/idp/authn/duo/impl/DuoSupport.java | 8 ++--
idp-cas-impl/pom.xml | 6 +--
.../cas/flow/impl/ValidateProxyCallbackAction.java | 3 +-
.../cas/proxy/impl/HttpClientProxyValidator.java | 45 +++++++++++-----------
.../idp/cli/AbstractIdPHomeAwareCommandLine.java | 2 +-
.../AbstractIdPHomeAwareCommandLineArguments.java | 1 -
idp-conf/pom.xml | 4 +-
idp-conf/src/main/resources/conf/logback.xml | 2 +-
.../idp/test/flows/cas/TestProxyValidator.java | 3 +-
idp-installer/pom.xml | 4 +-
.../idp/installer/plugin/impl/PluginInstaller.java | 2 +-
.../installer/plugin/impl/PluginInstallerCLI.java | 2 +-
.../idp/installer/plugin/impl/PluginState.java | 2 +-
.../idp/installer/plugin/impl/PluginCLITest.java | 2 +-
.../installer/plugin/impl/PluginInstallerTest.java | 2 +-
23 files changed, 87 insertions(+), 88 deletions(-)
diff --git a/idp-admin-api/pom.xml b/idp-admin-api/pom.xml
index 692dc0457..bb45b6a60 100644
--- a/idp-admin-api/pom.xml
+++ b/idp-admin-api/pom.xml
@@ -66,13 +66,12 @@
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>${httpclient.groupId}</groupId>
+ <artifactId>${httpclient.artifactId}</artifactId>
</dependency>
-
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
+ <groupId>${httpclient.httpcore.groupId}</groupId>
+ <artifactId>${httpclient.httpcore.artifactId}</artifactId>
</dependency>
<dependency>
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
index 256f95002..dd56efbad 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
@@ -41,10 +41,10 @@ import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.hc.client5.http.classic.methods.HttpGet;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
+import org.apache.hc.client5.http.protocol.HttpClientContext;
+import org.apache.hc.core5.http.ClassicHttpResponse;
import org.opensaml.security.httpclient.HttpClientSecuritySupport;
import org.slf4j.Logger;
import org.springframework.core.io.ClassPathResource;
@@ -376,14 +376,14 @@ public abstract class AbstractIdPModule implements IdPModule {
assert clientContext != null;
HttpClientSecuritySupport.marshalSecurityParameters(clientContext,
moduleContext.getHttpClientSecurityParameters(), true);
- HttpResponse response = null;
+ ClassicHttpResponse response = null;
try {
log.debug("Module {} fetching HTTP resource {}", getId(), uri);
final HttpGet request = new HttpGet(uri);
response = Constraint.isNotNull(
- moduleContext.getHttpClient(), "HttpClient cannot be null").execute(request, clientContext);
- HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getURI().getScheme());
- if (response.getStatusLine().getStatusCode() != 200) {
+ moduleContext.getHttpClient(), "HttpClient cannot be null").executeOpen(null, request, clientContext);
+ HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getScheme());
+ if (response.getCode() != 200) {
throw new IOException("HTTP request was unsuccessful");
}
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/module/IdPModule.java b/idp-admin-api/src/main/java/net/shibboleth/idp/module/IdPModule.java
index cd5d21102..cc32b617c 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/module/IdPModule.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/module/IdPModule.java
@@ -24,8 +24,6 @@ import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.apache.http.client.HttpClient;
-
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.annotation.constraint.NotLive;
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/module/ModuleContext.java b/idp-admin-api/src/main/java/net/shibboleth/idp/module/ModuleContext.java
index 44a514c6d..1aae33d54 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/module/ModuleContext.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/module/ModuleContext.java
@@ -25,7 +25,7 @@ import java.util.Locale.LanguageRange;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-authn-impl/pom.xml b/idp-authn-impl/pom.xml
index a19971159..56e598688 100644
--- a/idp-authn-impl/pom.xml
+++ b/idp-authn-impl/pom.xml
@@ -160,13 +160,14 @@
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
</dependency>
+
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>${httpclient.groupId}</groupId>
+ <artifactId>${httpclient.artifactId}</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
+ <groupId>${httpclient.httpcore.groupId}</groupId>
+ <artifactId>${httpclient.httpcore.artifactId}</artifactId>
</dependency>
<dependency>
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java
index ee765f422..70523e6f9 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java
@@ -24,12 +24,11 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.hc.client5.http.classic.HttpClient;
+import org.apache.hc.client5.http.protocol.HttpClientContext;
+import org.apache.hc.core5.http.ClassicHttpRequest;
+import org.apache.hc.core5.http.ClassicHttpResponse;
+import org.apache.hc.core5.http.HttpStatus;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import org.opensaml.security.httpclient.HttpClientSecuritySupport;
@@ -115,19 +114,19 @@ public abstract class AbstractDuoAuthenticator extends AbstractInitializableComp
* @throws ClientProtocolException on an HTTP error
* @throws DuoWebException on a Duo-related error
*/
- protected <T extends DuoResponseWrapper<?>> T doAPIRequest(@Nonnull final HttpUriRequest request,
+ protected <T extends DuoResponseWrapper<?>> T doAPIRequest(@Nonnull final ClassicHttpRequest request,
@Nonnull final TypeReference<T> wrapperTypeRef)
- throws DuoWebException, ClientProtocolException, IOException {
+ throws DuoWebException, IOException {
// Make the request.
final HttpClientContext clientContext = HttpClientContext.create();
HttpClientSecuritySupport.marshalSecurityParameters(clientContext, httpClientSecurityParameters, true);
HttpClientSecuritySupport.addDefaultTLSTrustEngineCriteria(clientContext, request);
- final HttpResponse httpResponse = httpClient.execute(request, clientContext);
- HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getURI().getScheme());
+ final ClassicHttpResponse httpResponse = httpClient.executeOpen(null, request, clientContext);
+ HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getScheme());
// Check the HTTP response code.
- final int httpStatusCode = httpResponse.getStatusLine().getStatusCode();
+ final int httpStatusCode = httpResponse.getCode();
if (httpStatusCode == HttpStatus.SC_BAD_REQUEST) {
final InputStream httpContent = httpResponse.getEntity().getContent();
final DuoFailureResponse msg = objectMapper.readValue(httpContent, DuoFailureResponse.class);
@@ -140,7 +139,7 @@ public abstract class AbstractDuoAuthenticator extends AbstractInitializableComp
}
if (httpStatusCode != HttpStatus.SC_OK) {
throw new IOException("Non-ok status code (" + httpStatusCode + ") returned from Duo: "
- + httpResponse.getStatusLine().getReasonPhrase());
+ + httpResponse.getReasonPhrase());
} else if (httpResponse.getEntity() == null) {
throw new IOException("No response body returned from Duo");
}
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoAuthAuthenticator.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoAuthAuthenticator.java
index 68eaea548..2a463a68e 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoAuthAuthenticator.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoAuthAuthenticator.java
@@ -27,9 +27,9 @@ import java.util.Map;
import javax.annotation.Nonnull;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.methods.RequestBuilder;
-import org.apache.http.client.utils.URIBuilder;
+import org.apache.hc.core5.http.ClassicHttpRequest;
+import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
+import org.apache.hc.core5.net.URIBuilder;
import com.duosecurity.duoweb.DuoWebException;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -75,8 +75,8 @@ public class DuoAuthAuthenticator extends AbstractDuoAuthenticator {
// prepare the request
final URI uri = new URIBuilder().setScheme("https").setHost(duoIntegration.getAPIHost())
.setPath("/auth/v2/auth").build();
- final RequestBuilder rb =
- RequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME, duoContext.getUsername());
+ final ClassicRequestBuilder rb =
+ ClassicRequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME, duoContext.getUsername());
if (duoContext.getClientAddress() != null) {
rb.addParameter(DuoAuthAPI.DUO_IPADDR, duoContext.getClientAddress());
}
@@ -97,7 +97,7 @@ public class DuoAuthAuthenticator extends AbstractDuoAuthenticator {
rb.addParameter(DuoAuthAPI.DUO_PUSHINFO, StringSupport.listToStringValue(pushinfo, "&"));
}
DuoSupport.signRequest(rb, duoIntegration);
- final HttpUriRequest request = rb.build();
+ final ClassicHttpRequest request = rb.build();
// do it
return doAPIRequest(request, wrapperTypeRef).getResponse();
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoPreauthAuthenticator.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoPreauthAuthenticator.java
index c5ce26287..20ca5ff3d 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoPreauthAuthenticator.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoPreauthAuthenticator.java
@@ -25,14 +25,14 @@ import java.security.NoSuchAlgorithmException;
import javax.annotation.Nonnull;
+import org.apache.hc.core5.http.ClassicHttpRequest;
+import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
+import org.apache.hc.core5.net.URIBuilder;
+
import com.duosecurity.duoweb.DuoWebException;
//import javax.json.JsonObject;
import com.fasterxml.jackson.core.type.TypeReference;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.methods.RequestBuilder;
-import org.apache.http.client.utils.URIBuilder;
-
import net.shibboleth.idp.authn.duo.DuoAuthAPI;
import net.shibboleth.idp.authn.duo.DuoIntegration;
import net.shibboleth.idp.authn.duo.context.DuoAuthenticationContext;
@@ -66,15 +66,15 @@ public class DuoPreauthAuthenticator extends AbstractDuoAuthenticator {
// Prepare the request
final URI uri = new URIBuilder().setScheme("https").setHost(duoIntegration.getAPIHost())
.setPath("/auth/v2/preauth").build();
- final RequestBuilder rb =
- RequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME, duoContext.getUsername());
+ final ClassicRequestBuilder rb =
+ ClassicRequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME, duoContext.getUsername());
if (duoContext.getClientAddress() != null) {
rb.addParameter(DuoAuthAPI.DUO_IPADDR, duoContext.getClientAddress());
}
DuoSupport.signRequest(rb, duoIntegration);
- final HttpUriRequest request = rb.build();
+ final ClassicHttpRequest request = rb.build();
return doAPIRequest(request, wrapperTypeRef).getResponse();
} catch (final IOException | URISyntaxException | InvalidKeyException | NoSuchAlgorithmException ex) {
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java
index b2f958d71..e08de4dc8 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java
@@ -42,8 +42,8 @@ import java.util.List;
import javax.annotation.Nonnull;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.methods.RequestBuilder;
+import org.apache.hc.core5.http.NameValuePair;
+import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
/**
* Helpers for DuoWeb and Duo AuthAPI operations.
@@ -129,7 +129,7 @@ public final class DuoSupport {
*
* @since 3.4.0
*/
- @NotEmpty public static void signRequest(@Nonnull final RequestBuilder request,
+ @NotEmpty public static void signRequest(@Nonnull final ClassicRequestBuilder request,
@Nonnull final DuoIntegration duo)
throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException {
final String ikey = duo.getIntegrationKey();
@@ -156,7 +156,7 @@ public final class DuoSupport {
*
* @throws UnsupportedEncodingException failure from {@link java.net.URLEncoder}
*/
- private static String canonRequest(@Nonnull final RequestBuilder request, @Nonnull final String date,
+ private static String canonRequest(@Nonnull final ClassicRequestBuilder request, @Nonnull final String date,
final int sigVersion) throws UnsupportedEncodingException {
final URI uri = request.getUri();
String canon = "";
diff --git a/idp-cas-impl/pom.xml b/idp-cas-impl/pom.xml
index 5b028f779..228398208 100644
--- a/idp-cas-impl/pom.xml
+++ b/idp-cas-impl/pom.xml
@@ -115,11 +115,11 @@
<dependency>
<groupId>${httpclient.groupId}</groupId>
- <artifactId>httpclient</artifactId>
+ <artifactId>${httpclient.artifactId}</artifactId>
</dependency>
<dependency>
- <groupId>${httpclient.groupId}</groupId>
- <artifactId>httpcore</artifactId>
+ <groupId>${httpclient.httpcore.groupId}</groupId>
+ <artifactId>${httpclient.httpcore.artifactId}</artifactId>
</dependency>
<!-- Provided Dependencies -->
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackAction.java
index eccdd299c..625514e8f 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackAction.java
@@ -24,7 +24,8 @@ import java.time.Instant;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.apache.http.client.utils.URIBuilder;
+import org.apache.hc.core5.net.URIBuilder;
+
import org.opensaml.profile.action.ActionSupport;
import org.opensaml.profile.action.EventException;
import org.opensaml.profile.action.EventIds;
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
index 97830c4a2..1d5740593 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
@@ -33,12 +33,24 @@ import javax.net.ssl.SSLPeerUnverifiedException;
import javax.security.auth.login.CredentialException;
import javax.security.auth.login.FailedLoginException;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.protocol.HttpClientContext;
+import net.shibboleth.idp.cas.config.AbstractProtocolConfiguration;
+import net.shibboleth.idp.cas.protocol.ProtocolContext;
+import net.shibboleth.idp.cas.proxy.ProxyValidator;
+import net.shibboleth.idp.cas.service.Service;
+import net.shibboleth.idp.cas.service.ServiceContext;
+import net.shibboleth.shared.annotation.constraint.NonnullElements;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.resolver.CriteriaSet;
+
+import org.apache.hc.client5.http.ClientProtocolException;
+import org.apache.hc.client5.http.classic.HttpClient;
+import org.apache.hc.client5.http.classic.methods.HttpGet;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
+import org.apache.hc.client5.http.protocol.HttpClientContext;
+import org.apache.hc.core5.http.ClassicHttpResponse;
+
import org.opensaml.core.criterion.EntityIdCriterion;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -53,19 +65,8 @@ import org.opensaml.security.trust.TrustEngine;
import org.opensaml.security.x509.TrustedNamesCriterion;
import org.slf4j.Logger;
-import net.shibboleth.idp.cas.config.AbstractProtocolConfiguration;
-import net.shibboleth.idp.cas.protocol.ProtocolContext;
-import net.shibboleth.idp.cas.proxy.ProxyValidator;
-import net.shibboleth.idp.cas.service.Service;
-import net.shibboleth.idp.cas.service.ServiceContext;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.shared.resolver.CriteriaSet;
-
/**
- * Authenticates a CAS proxy callback endpoint using an {@link org.apache.http.client.HttpClient} instance to establish
+ * Authenticates a CAS proxy callback endpoint using an {@link org.apache.hc.client5.http.classic.HttpClient} instance to establish
* the connection and a {@link TrustEngine} to verify the TLS certificate presented by the remote peer. The endpoint
* is validated if and only if the following requirements are met:
*
@@ -157,13 +158,13 @@ public class HttpClientProxyValidator implements ProxyValidator {
final HttpClientContext clientContext = HttpClientContext.create();
HttpClientSecuritySupport.marshalSecurityParameters(clientContext, securityParameters, true);
setCASTLSTrustEngineCriteria(clientContext, uri, service);
- HttpResponse response = null;
+ ClassicHttpResponse response = null;
try {
log.debug("Attempting to validate CAS proxy callback URI {}", uri);
final HttpGet request = new HttpGet(uri);
- response = httpClient.execute(request, clientContext);
- HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getURI().getScheme());
- return response.getStatusLine().getStatusCode();
+ response = httpClient.executeOpen(null, request, clientContext);
+ HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getScheme());
+ return response.getCode();
} catch (final ClientProtocolException e) {
throw new GeneralSecurityException("HTTP protocol error", e);
} catch (final SSLPeerUnverifiedException e) {
diff --git a/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLine.java b/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLine.java
index c5b41b8a8..08d4b23f0 100644
--- a/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLine.java
+++ b/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLine.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.cli;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
diff --git a/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLineArguments.java b/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLineArguments.java
index 181b35295..007102e79 100644
--- a/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLineArguments.java
+++ b/idp-cli/src/main/java/net/shibboleth/idp/cli/AbstractIdPHomeAwareCommandLineArguments.java
@@ -21,7 +21,6 @@ import java.io.PrintStream;
import javax.annotation.Nullable;
-import org.apache.http.client.HttpClient;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import com.beust.jcommander.Parameter;
diff --git a/idp-conf/pom.xml b/idp-conf/pom.xml
index 5320ed3a0..c95143e27 100644
--- a/idp-conf/pom.xml
+++ b/idp-conf/pom.xml
@@ -274,8 +274,8 @@
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>${httpclient.groupId}</groupId>
+ <artifactId>${httpclient.artifactId}</artifactId>
<scope>test</scope>
</dependency>
diff --git a/idp-conf/src/main/resources/conf/logback.xml b/idp-conf/src/main/resources/conf/logback.xml
index a4c94d11f..85e6cc0fd 100644
--- a/idp-conf/src/main/resources/conf/logback.xml
+++ b/idp-conf/src/main/resources/conf/logback.xml
@@ -48,7 +48,7 @@
<logger name="org.ldaptive" level="${idp.loglevel.ldap}"/>
<!-- Logs embedded HTTP client messages -->
- <logger name="org.apache.http" level="${idp.loglevel.httpclient}"/>
+ <logger name="org.apache.hc" level="${idp.loglevel.httpclient}"/>
<!-- Logs inbound and outbound protocols messages at DEBUG level -->
<logger name="PROTOCOL_MESSAGE" level="${idp.loglevel.messages}" />
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java
index bc54b3647..9d0236bc4 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java
@@ -19,7 +19,8 @@ package net.shibboleth.idp.test.flows.cas;
import net.shibboleth.idp.cas.proxy.impl.HttpClientProxyValidator;
import net.shibboleth.idp.cas.service.Service;
-import org.apache.http.impl.client.HttpClients;
+
+import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import javax.annotation.Nonnull;
diff --git a/idp-installer/pom.xml b/idp-installer/pom.xml
index 39132e4b4..aa2a3a5e0 100644
--- a/idp-installer/pom.xml
+++ b/idp-installer/pom.xml
@@ -82,8 +82,8 @@
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>${httpclient.groupId}</groupId>
+ <artifactId>${httpclient.artifactId}</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
index 0f5f2bb28..f886131fd 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
@@ -60,7 +60,7 @@ import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.compress.utils.IOUtils;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.tools.ant.BuildException;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import org.slf4j.Logger;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
index 4d7262731..57021d446 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
@@ -38,7 +38,7 @@ import java.util.function.Predicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.tools.ant.BuildException;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.slf4j.Logger;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java
index c97b909c5..a48966bae 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java
@@ -24,7 +24,7 @@ import java.util.Properties;
import javax.annotation.Nonnull;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.slf4j.Logger;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginCLITest.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginCLITest.java
index 6ff3ad6bd..0958ddeb3 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginCLITest.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginCLITest.java
@@ -26,7 +26,7 @@ import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.testng.annotations.BeforeSuite;
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerTest.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerTest.java
index 04345a596..7d67b0066 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerTest.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerTest.java
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import org.apache.http.client.HttpClient;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.slf4j.Logger;
import org.testng.annotations.BeforeClass;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list