Package com.unboundid.util.ssl
Class TrustAllSSLSocketVerifier
java.lang.Object
com.unboundid.util.ssl.SSLSocketVerifier
com.unboundid.util.ssl.TrustAllSSLSocketVerifier
- All Implemented Interfaces:
HostnameVerifier
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class TrustAllSSLSocketVerifier
extends SSLSocketVerifier
implements HostnameVerifier
This class provides an implementation of an
SSLSocket verifier that
will blindly accept any SSLSocket.-
Method Summary
Modifier and TypeMethodDescriptionstatic TrustAllSSLSocketVerifierRetrieves a singleton instance of this SSL socket verifier.booleanverify(String hostname, SSLSession session) Verifies that the provided hostname is acceptable for use with the negotiated SSL session.voidverifySSLSocket(String host, int port, SSLSocket sslSocket) Verifies that the providedSSLSocketis acceptable and the connection should be allowed to remain established.
-
Method Details
-
getInstance
Retrieves a singleton instance of this SSL socket verifier.- Returns:
- A singleton instance of this SSL socket verifier.
-
verifySSLSocket
public void verifySSLSocket(@NotNull String host, int port, @NotNull SSLSocket sslSocket) throws LDAPException Verifies that the providedSSLSocketis acceptable and the connection should be allowed to remain established.- Specified by:
verifySSLSocketin classSSLSocketVerifier- Parameters:
host- The address to which the client intended the connection to be established.port- The port to which the client intended the connection to be established.sslSocket- TheSSLSocketthat should be verified.- Throws:
LDAPException- If a problem is identified that should prevent the providedSSLSocketfrom remaining established.
-
verify
Verifies that the provided hostname is acceptable for use with the negotiated SSL session.- Specified by:
verifyin interfaceHostnameVerifier- Parameters:
hostname- The address to which the client intended the connection to be established.session- The SSL session that was established.
-