Skip to content

Commit

Permalink
Corrected APIs in ClientTlsStrategyBuilder to be compatible with Clas…
Browse files Browse the repository at this point in the history
…sic APIs
  • Loading branch information
ok2c committed Feb 16, 2025
1 parent 1fb9a4e commit 0e5497a
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0e5497a

Please sign in to comment.