From 7b63ac34e0574d4046f35c2e3cdb70ded8a8fea0 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Thu, 12 Dec 2024 22:35:11 +0100 Subject: [PATCH 1/4] Update Apache AsyncHttpClient --- .../commercetools-apachehttp-client/build.gradle | 4 ++-- .../http/apachehttp/CtApacheHttpClient.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/commercetools/commercetools-apachehttp-client/build.gradle b/commercetools/commercetools-apachehttp-client/build.gradle index 52af4078c29..91b932ac590 100644 --- a/commercetools/commercetools-apachehttp-client/build.gradle +++ b/commercetools/commercetools-apachehttp-client/build.gradle @@ -1,9 +1,9 @@ dependencies { api project(":rmf:rmf-java-base") - api "org.apache.httpcomponents.client5:httpclient5:5.3.1" version { + api "org.apache.httpcomponents.client5:httpclient5:5.4.1" version { strictly "[5.0,6.0[" - prefer "5.1.3" + prefer "5.4.1" } api commons.io version commons.io_version diff --git a/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/CtApacheHttpClient.java b/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/CtApacheHttpClient.java index d0599578dc8..6401f0a9775 100644 --- a/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/CtApacheHttpClient.java +++ b/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/CtApacheHttpClient.java @@ -19,6 +19,7 @@ import org.apache.hc.client5.http.async.methods.SimpleBody; import org.apache.hc.client5.http.async.methods.SimpleHttpResponse; import org.apache.hc.client5.http.async.methods.SimpleResponseConsumer; +import org.apache.hc.client5.http.config.TlsConfig; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; import org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder; import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder; @@ -32,7 +33,6 @@ import org.apache.hc.core5.http.nio.support.AsyncRequestBuilder; import org.apache.hc.core5.http2.HttpVersionPolicy; import org.apache.hc.core5.reactor.IOReactorStatus; -import org.apache.hc.core5.reactor.ssl.TlsDetails; public class CtApacheHttpClient extends HttpClientBase { public static final int MAX_REQUESTS = 64; @@ -46,19 +46,19 @@ public static HttpAsyncClientBuilder createClientBuilder() { } public static HttpAsyncClientBuilder createClientBuilder(AsyncClientConnectionManager cm) { - return HttpAsyncClientBuilder.create().setVersionPolicy(HttpVersionPolicy.NEGOTIATE).setConnectionManager(cm); + return HttpAsyncClientBuilder.create().setConnectionManager(cm); } public static PoolingAsyncClientConnectionManagerBuilder createConnectionManager(final int maxConnTotal, final int maxConnPerRoute) { - final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create() - .useSystemProperties() - .setTlsDetailsFactory( - sslEngine -> new TlsDetails(sslEngine.getSession(), sslEngine.getApplicationProtocol())) + final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create().useSystemProperties().build(); + final TlsConfig tlsConfig = TlsConfig.copy(TlsConfig.DEFAULT) + .setVersionPolicy(HttpVersionPolicy.NEGOTIATE) .build(); return PoolingAsyncClientConnectionManagerBuilder.create() .setMaxConnPerRoute(maxConnPerRoute) .setMaxConnTotal(maxConnTotal) + .setDefaultTlsConfig(tlsConfig) .setTlsStrategy(tlsStrategy); } From 3241ca6a894ef990a2f822e0e044199cdd54a0c3 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:40:08 +0000 Subject: [PATCH 2/4] TASK: Updating license information --- .../index.json | 19 +++---------------- licenses/index.json | 19 +++---------------- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/licenses/commercetools-apachehttp-client/index.json b/licenses/commercetools-apachehttp-client/index.json index 3971f070a14..30776393058 100644 --- a/licenses/commercetools-apachehttp-client/index.json +++ b/licenses/commercetools-apachehttp-client/index.json @@ -78,19 +78,6 @@ } ] }, - { - "moduleName": "commons-codec:commons-codec", - "moduleVersion": "1.15", - "moduleUrls": [ - "https://commons.apache.org/proper/commons-codec/" - ], - "moduleLicenses": [ - { - "moduleLicense": "Apache License, Version 2.0", - "moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0" - } - ] - }, { "moduleName": "commons-io:commons-io", "moduleVersion": "2.11.0", @@ -155,7 +142,7 @@ }, { "moduleName": "org.apache.httpcomponents.client5:httpclient5", - "moduleVersion": "5.1.3", + "moduleVersion": "5.4.1", "moduleLicenses": [ { "moduleLicense": "Apache License, Version 2.0", @@ -165,7 +152,7 @@ }, { "moduleName": "org.apache.httpcomponents.core5:httpcore5", - "moduleVersion": "5.1.3", + "moduleVersion": "5.3.1", "moduleLicenses": [ { "moduleLicense": "Apache License, Version 2.0", @@ -175,7 +162,7 @@ }, { "moduleName": "org.apache.httpcomponents.core5:httpcore5-h2", - "moduleVersion": "5.1.3", + "moduleVersion": "5.3.1", "moduleLicenses": [ { "moduleLicense": "Apache License, Version 2.0", diff --git a/licenses/index.json b/licenses/index.json index e11b88ee554..87cb1b6dc01 100644 --- a/licenses/index.json +++ b/licenses/index.json @@ -563,19 +563,6 @@ } ] }, - { - "moduleName": "commons-codec:commons-codec", - "moduleVersion": "1.15", - "moduleUrls": [ - "https://commons.apache.org/proper/commons-codec/" - ], - "moduleLicenses": [ - { - "moduleLicense": "Apache License, Version 2.0", - "moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0" - } - ] - }, { "moduleName": "commons-io:commons-io", "moduleVersion": "2.11.0", @@ -1220,7 +1207,7 @@ }, { "moduleName": "org.apache.httpcomponents.client5:httpclient5", - "moduleVersion": "5.1.3", + "moduleVersion": "5.4.1", "moduleLicenses": [ { "moduleLicense": "Apache License, Version 2.0", @@ -1230,7 +1217,7 @@ }, { "moduleName": "org.apache.httpcomponents.core5:httpcore5", - "moduleVersion": "5.1.3", + "moduleVersion": "5.3.1", "moduleLicenses": [ { "moduleLicense": "Apache License, Version 2.0", @@ -1240,7 +1227,7 @@ }, { "moduleName": "org.apache.httpcomponents.core5:httpcore5-h2", - "moduleVersion": "5.1.3", + "moduleVersion": "5.3.1", "moduleLicenses": [ { "moduleLicense": "Apache License, Version 2.0", From 6440c63148b1a5a2b250762a86b24222fe4c8b21 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Thu, 19 Dec 2024 10:17:27 +0100 Subject: [PATCH 3/4] force recent Apache client with HPACK fixes --- commercetools/commercetools-apachehttp-client/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commercetools/commercetools-apachehttp-client/build.gradle b/commercetools/commercetools-apachehttp-client/build.gradle index 91b932ac590..d7f7ac4f03c 100644 --- a/commercetools/commercetools-apachehttp-client/build.gradle +++ b/commercetools/commercetools-apachehttp-client/build.gradle @@ -2,7 +2,7 @@ dependencies { api project(":rmf:rmf-java-base") api "org.apache.httpcomponents.client5:httpclient5:5.4.1" version { - strictly "[5.0,6.0[" + strictly "[5.4.1,6.0[" prefer "5.4.1" } From 1d8f3f6ec84d731d5957b013a1786b5fb7141035 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Thu, 19 Dec 2024 10:35:09 +0100 Subject: [PATCH 4/4] add solutioninfo for Apache client --- .../apachehttp/ApacheHttpClientSolutionInfo.java | 13 +++++++++++++ .../services/io.vrap.rmf.base.client.SolutionInfo | 1 + 2 files changed, 14 insertions(+) create mode 100644 commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/ApacheHttpClientSolutionInfo.java create mode 100644 commercetools/commercetools-apachehttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.SolutionInfo diff --git a/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/ApacheHttpClientSolutionInfo.java b/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/ApacheHttpClientSolutionInfo.java new file mode 100644 index 00000000000..00bcba8987f --- /dev/null +++ b/commercetools/commercetools-apachehttp-client/src/main/java/com/commercetools/http/apachehttp/ApacheHttpClientSolutionInfo.java @@ -0,0 +1,13 @@ + +package com.commercetools.http.apachehttp; + +import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.hc.core5.util.VersionInfo; + +public class ApacheHttpClientSolutionInfo extends io.vrap.rmf.base.client.SolutionInfo { + public ApacheHttpClientSolutionInfo() { + setName("ApacheHttpAsyncClient"); + setVersion( + VersionInfo.loadVersionInfo("org.apache.hc.client5", HttpClient.class.getClassLoader()).getRelease()); + } +} diff --git a/commercetools/commercetools-apachehttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.SolutionInfo b/commercetools/commercetools-apachehttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.SolutionInfo new file mode 100644 index 00000000000..8b9f6eb82e1 --- /dev/null +++ b/commercetools/commercetools-apachehttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.SolutionInfo @@ -0,0 +1 @@ +com.commercetools.http.apachehttp.ApacheHttpClientSolutionInfo