chore(deps): Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.1 (#95)

* chore(deps): Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.1

* fix: resolve deprecations

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: zml <zml@stellardrift.ca>
This commit is contained in:
renovate[bot]andzml authored and GitHub committed 2023-07-07 18:38:16 -07:00
1 parent 7711f24d1b
commit 0d70e5bc4e
5 files changed
+1 -105

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ mergeTool = "1.1.7"
checkerQual = { module = "org.checkerframework:checker-qual", version.ref = "checker" }
# downloader-apache-http
apache-httpClient5 = { module = "org.apache.httpcomponents.client5:httpclient5", version = "5.1.3" }
apache-httpClient5 = { module = "org.apache.httpcomponents.client5:httpclient5", version = "5.2.1" }
# gradle-plugin
accessWidener = { module = "net.fabricmc:access-widener", version.ref = "accessWidener" }
@@ -8,9 +8,3 @@ dependencies {
api(project(":vanillagradle-resolver-core"))
implementation(libs.apache.httpClient5)
}
sourceSets {
main {
multirelease.alternateVersions(9)
}
}
@@ -29,17 +29,13 @@ import org.apache.hc.client5.http.async.methods.SimpleRequestProducer;
import org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy;
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.PoolingAsyncClientConnectionManager;
import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder;
import org.apache.hc.core5.http.HttpResponse;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.Message;
import org.apache.hc.core5.http.nio.AsyncEntityConsumer;
import org.apache.hc.core5.http.nio.entity.BasicAsyncEntityConsumer;
import org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer;
import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
import org.apache.hc.core5.http.nio.support.BasicResponseConsumer;
import org.apache.hc.core5.http2.HttpVersionPolicy;
import org.apache.hc.core5.io.CloseMode;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.util.TimeValue;
@@ -113,16 +109,9 @@ public final class ApacheHttpDownloader implements AutoCloseable, Downloader {
.setSoTimeout(Timeout.ofSeconds(5))
.build();
final TlsStrategy tlsStrategy = TlsStrategyProvider.provide();
final PoolingAsyncClientConnectionManager cm = PoolingAsyncClientConnectionManagerBuilder.create()
.setTlsStrategy(tlsStrategy)
.build();
this.client = HttpAsyncClientBuilder.create()
.setIOReactorConfig(config)
.setUserAgent("vanillagradle-resolver/" + this.getClass().getPackage().getImplementationVersion()) // todo: re-implement
.setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
.setConnectionManager(cm)
.setRetryStrategy(new DefaultHttpRequestRetryStrategy(5, TimeValue.ofMilliseconds(500)))
.build();
this.shouldClose = true;
@@ -1,41 +0,0 @@
/*
* This file is part of VanillaGradle, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.gradle.vanilla.resolver.apache;
import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder;
import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
final class TlsStrategyProvider {
private TlsStrategyProvider() {
}
static TlsStrategy provide() {
return ClientTlsStrategyBuilder.create()
.useSystemProperties()
.build();
}
}
@@ -1,46 +0,0 @@
/*
* This file is part of VanillaGradle, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.gradle.vanilla.resolver.apache;
import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder;
import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
import org.apache.hc.core5.reactor.ssl.TlsDetails;
// See main source set
final class TlsStrategyProvider {
private TlsStrategyProvider() {
}
static TlsStrategy provide() {
return ClientTlsStrategyBuilder.create()
.useSystemProperties()
.setTlsDetailsFactory(engine -> {
return new TlsDetails(engine.getSession(), engine.getApplicationProtocol());
})
.build();
}
}