Package com.unboundid.util.ssl
Class TrustAllSSLSocketVerifier
- java.lang.Object
-
- com.unboundid.util.ssl.SSLSocketVerifier
-
- com.unboundid.util.ssl.TrustAllSSLSocketVerifier
-
- All Implemented Interfaces:
javax.net.ssl.HostnameVerifier
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class TrustAllSSLSocketVerifier extends SSLSocketVerifier implements javax.net.ssl.HostnameVerifier
This class provides an implementation of anSSLSocket
verifier that will blindly accept anySSLSocket
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TrustAllSSLSocketVerifier
getInstance()
Retrieves a singleton instance of this SSL socket verifier.boolean
verify(java.lang.String hostname, javax.net.ssl.SSLSession session)
Verifies that the provided hostname is acceptable for use with the negotiated SSL session.void
verifySSLSocket(java.lang.String host, int port, javax.net.ssl.SSLSocket sslSocket)
Verifies that the providedSSLSocket
is acceptable and the connection should be allowed to remain established.
-
-
-
Method Detail
-
getInstance
@NotNull public static TrustAllSSLSocketVerifier getInstance()
Retrieves a singleton instance of this SSL socket verifier.- Returns:
- A singleton instance of this SSL socket verifier.
-
verifySSLSocket
public void verifySSLSocket(@NotNull java.lang.String host, int port, @NotNull javax.net.ssl.SSLSocket sslSocket) throws LDAPException
Verifies that the providedSSLSocket
is acceptable and the connection should be allowed to remain established.- Specified by:
verifySSLSocket
in 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
- TheSSLSocket
that should be verified.- Throws:
LDAPException
- If a problem is identified that should prevent the providedSSLSocket
from remaining established.
-
verify
public boolean verify(@NotNull java.lang.String hostname, @NotNull javax.net.ssl.SSLSession session)
Verifies that the provided hostname is acceptable for use with the negotiated SSL session.- Specified by:
verify
in interfacejavax.net.ssl.HostnameVerifier
- Parameters:
hostname
- The address to which the client intended the connection to be established.session
- The SSL session that was established.
-
-