From 232730dbbbbab342cf98191015e609f36fa8f76f Mon Sep 17 00:00:00 2001 From: timis1 <12120641+timis1@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:27:02 +0200 Subject: [PATCH] JAVA-27674 Upgrade apache-httpclient to v5 (#15329) --- apache-httpclient/pom.xml | 12 +++--------- .../baeldung/httpclient/HttpAsyncClientLiveTest.java | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apache-httpclient/pom.xml b/apache-httpclient/pom.xml index 3b178d4df8..f671c93cfc 100644 --- a/apache-httpclient/pom.xml +++ b/apache-httpclient/pom.xml @@ -63,11 +63,6 @@ ${wiremock.version} test - - org.apache.httpcomponents - httpclient - ${httpclient.version} - @@ -84,10 +79,9 @@ 5.6.1 3.3.1 - 5.2 - 5.2 - 5.2 - 4.5.14 + 5.2.2 + 5.2.2 + 5.2.2 diff --git a/apache-httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java b/apache-httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java index 50cf1b7a64..7b818f871a 100644 --- a/apache-httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java +++ b/apache-httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java @@ -25,6 +25,7 @@ import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBu import org.apache.hc.client5.http.impl.routing.DefaultProxyRoutePlanner; import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder; +import org.apache.hc.client5.http.ssl.NoopHostnameVerifier; import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.nio.ssl.TlsStrategy; @@ -33,7 +34,6 @@ import org.apache.hc.core5.http.protocol.HttpContext; import org.apache.hc.core5.reactor.IOReactorConfig; import org.apache.hc.core5.ssl.SSLContexts; import org.apache.hc.core5.ssl.TrustStrategy; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.junit.jupiter.api.Test; @@ -120,7 +120,7 @@ class HttpAsyncClientLiveTest extends GetRequestMockServer { .build(); final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create() - .setHostnameVerifier(SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER) + .setHostnameVerifier(NoopHostnameVerifier.INSTANCE) .setSslContext(sslContext) .build();