Skip to content

Commit 0e5497a

Browse files
committed
Corrected APIs in ClientTlsStrategyBuilder to be compatible with Classic APIs
1 parent 1fb9a4e commit 0e5497a

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/ssl/ClientTlsStrategyBuilder.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
import org.apache.hc.core5.ssl.SSLContexts;
4040

4141
/**
42-
* Builder for client {@link TlsStrategy} instances.
42+
* Builder for client TLS strategy instances.
4343
* <p>
4444
* When a particular component is not explicitly set this class will
4545
* use its default implementation. System properties will be taken
4646
* into account when configuring the default implementations when
4747
* {@link #useSystemProperties()} method is called prior to calling
48-
* {@link #build()}.
48+
* {@link #buildAsync()} or {@link #buildClassic()}.
4949
* </p>
5050
* <ul>
5151
* <li>ssl.TrustManagerFactory.algorithm</li>
@@ -183,7 +183,29 @@ public final ClientTlsStrategyBuilder useSystemProperties() {
183183
return this;
184184
}
185185

186+
/**
187+
* @deprecated Use {@link #buildAsync()} or {@link #buildClassic()}.
188+
*/
189+
@Deprecated
186190
public TlsStrategy build() {
191+
return buildImpl();
192+
}
193+
194+
/**
195+
* @since 5.5
196+
*/
197+
public TlsStrategy buildAsync() {
198+
return buildImpl();
199+
}
200+
201+
/**
202+
* @since 5.5
203+
*/
204+
public TlsSocketStrategy buildClassic() {
205+
return buildImpl();
206+
}
207+
208+
private DefaultClientTlsStrategy buildImpl() {
187209
final SSLContext sslContextCopy;
188210
if (sslContext != null) {
189211
sslContextCopy = sslContext;

0 commit comments

Comments
 (0)