You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/02/16 11:37:24 UTC
(httpcomponents-client) branch master updated: Corrected APIs in ClientTlsStrategyBuilder to be compatible with Classic APIs
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
The following commit(s) were added to refs/heads/master by this push:
new 0e5497a72 Corrected APIs in ClientTlsStrategyBuilder to be compatible with Classic APIs
0e5497a72 is described below
commit 0e5497a72f3e04261cc8755d5cb10ea2635e7441
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Feb 16 12:34:48 2025 +0100
Corrected APIs in ClientTlsStrategyBuilder to be compatible with Classic APIs
---
.../client5/http/ssl/ClientTlsStrategyBuilder.java | 26 ++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/ClientTlsStrategyBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/ClientTlsStrategyBuilder.java
index 5f27f00e5..c73ee0b19 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/ClientTlsStrategyBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/ClientTlsStrategyBuilder.java
@@ -39,13 +39,13 @@
import org.apache.hc.core5.ssl.SSLContexts;
/**
- * Builder for client {@link TlsStrategy} instances.
+ * Builder for client TLS strategy instances.
* <p>
* When a particular component is not explicitly set this class will
* use its default implementation. System properties will be taken
* into account when configuring the default implementations when
* {@link #useSystemProperties()} method is called prior to calling
- * {@link #build()}.
+ * {@link #buildAsync()} or {@link #buildClassic()}.
* </p>
* <ul>
* <li>ssl.TrustManagerFactory.algorithm</li>
@@ -183,7 +183,29 @@ public final ClientTlsStrategyBuilder useSystemProperties() {
return this;
}
+ /**
+ * @deprecated Use {@link #buildAsync()} or {@link #buildClassic()}.
+ */
+ @Deprecated
public TlsStrategy build() {
+ return buildImpl();
+ }
+
+ /**
+ * @since 5.5
+ */
+ public TlsStrategy buildAsync() {
+ return buildImpl();
+ }
+
+ /**
+ * @since 5.5
+ */
+ public TlsSocketStrategy buildClassic() {
+ return buildImpl();
+ }
+
+ private DefaultClientTlsStrategy buildImpl() {
final SSLContext sslContextCopy;
if (sslContext != null) {
sslContextCopy = sslContext;