Class CustomTlsStrategy
java.lang.Object
org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy
org.wso2.carbon.utils.httpclient5.CustomTlsStrategy
- All Implemented Interfaces:
org.apache.hc.client5.http.ssl.TlsSocketStrategy,org.apache.hc.core5.http.nio.ssl.TlsStrategy
public class CustomTlsStrategy
extends org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy
Custom TLS strategy that disables Java's built-in hostname verification
to allow custom hostname verifiers to be the sole verification mechanism.
This is critical for ensuring that when a custom hostname verifier is provided,
Java's default endpoint identification algorithm does not interfere with the
custom verification logic. This strategy uses HostnameVerificationPolicy.CLIENT
which delegates all hostname verification to the provided custom verifier.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidinitializeEngine(SSLEngine arg0) protected voidinitializeSocket(SSLSocket arg0) upgrade(Socket arg0, String arg1, int arg2, Object arg3, org.apache.hc.core5.http.protocol.HttpContext arg4) booleanupgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer arg0, org.apache.hc.core5.http.HttpHost arg1, SocketAddress arg2, SocketAddress arg3, Object arg4, org.apache.hc.core5.util.Timeout arg5) Deprecated.voidupgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer arg0, org.apache.hc.core5.net.NamedEndpoint arg1, Object arg2, org.apache.hc.core5.util.Timeout arg3, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> arg4) protected voidverifySession(String arg0, SSLSession arg1) Methods inherited from class org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy
createDefault, createSystemDefault, getDefault, getSystemDefault
-
Constructor Details
-
CustomTlsStrategy
-
-
Method Details
-
upgrade
@Deprecated public boolean upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer arg0, org.apache.hc.core5.http.HttpHost arg1, SocketAddress arg2, SocketAddress arg3, Object arg4, org.apache.hc.core5.util.Timeout arg5) Deprecated.- Specified by:
upgradein interfaceorg.apache.hc.core5.http.nio.ssl.TlsStrategy
-
upgrade
public void upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer arg0, org.apache.hc.core5.net.NamedEndpoint arg1, Object arg2, org.apache.hc.core5.util.Timeout arg3, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> arg4) - Specified by:
upgradein interfaceorg.apache.hc.core5.http.nio.ssl.TlsStrategy
-
initializeEngine
-
initializeSocket
-
verifySession
- Throws:
SSLException
-
upgrade
public SSLSocket upgrade(Socket arg0, String arg1, int arg2, Object arg3, org.apache.hc.core5.http.protocol.HttpContext arg4) throws IOException - Specified by:
upgradein interfaceorg.apache.hc.client5.http.ssl.TlsSocketStrategy- Throws:
IOException
-