java.lang.Objectjavax.naming.ldap.StartTlsResponse
All Implemented Interfaces:
ExtendedResponse
The Start TLS extended request and response are used to establish a TLS connection over the existing LDAP connection associated with the JNDI context on which extendedOperation() is invoked. Typically, a JNDI program uses the StartTLS extended request and response classes as follows.
import javax.naming.ldap.*; // Open an LDAP association LdapContext ctx = new InitialLdapContext(); // Perform a StartTLS extended operation StartTlsResponse tls = (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest()); // Open a TLS connection (over the existing LDAP association) and get details // of the negotiated TLS session: cipher suite, peer certificate, ... SSLSession session = tls.negotiate(); // ... use ctx to perform protected LDAP operations // Close the TLS connection (revert back to the underlying LDAP association) tls.close(); // ... use ctx to perform unprotected LDAP operations // Close the LDAP association ctx.close;
1.4
- Vincent
- RyanField Summary | ||
---|---|---|
public static final String | OID | The StartTLS extended response's assigned object identifier is 1.3.6.1.4.1.1466.20037. |
Constructor: |
---|
|
Method from javax.naming.ldap.StartTlsResponse Summary: |
---|
close, getEncodedValue, getID, negotiate, negotiate, setEnabledCipherSuites, setHostnameVerifier |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.naming.ldap.StartTlsResponse Detail: |
---|
|
|
|
This method is equivalent to negotiate(null). |
Creates an SSL socket using the supplied SSL socket factory and attaches it to the existing connection. Performs the TLS handshake and returns the negotiated session information. If cipher suites have been set via setEnabledCipherSuites then they are enabled before the TLS handshake begins. Hostname verification is performed after the TLS handshake completes. The default hostname verification performs a match of the server's hostname against the hostname information found in the server's certificate. If this verification fails and no callback has been set via setHostnameVerifier then the negotiation fails. If this verification fails and a callback has been set via setHostnameVerifier, then the callback is used to determine whether the negotiation succeeds. If an error occurs then the SSL socket is closed and an IOException is thrown. The underlying connection remains intact. |
|
|