Methods Summary |
---|
public abstract void | close()Closes the TLS connection gracefully and reverts back to the underlying
connection.
|
public byte[] | getEncodedValue()Retrieves the StartTLS response's ASN.1 BER encoded value.
Since the response has no defined value, null is always
returned.
return null;
|
public java.lang.String | getID()Retrieves the StartTLS response's object identifier string.
return OID;
|
public abstract javax.net.ssl.SSLSession | negotiate()Negotiates a TLS session using the default SSL socket factory.
This method is equivalent to negotiate(null).
|
public abstract javax.net.ssl.SSLSession | negotiate(javax.net.ssl.SSLSocketFactory factory)Negotiates a TLS session using an SSL socket factory.
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.
|
public abstract void | setEnabledCipherSuites(java.lang.String[] suites)Overrides the default list of cipher suites enabled for use on the
TLS connection. The cipher suites must have already been listed by
SSLSocketFactory.getSupportedCipherSuites() as being supported.
Even if a suite has been enabled, it still might not be used because
the peer does not support it, or because the requisite certificates
(and private keys) are not available.
|
public abstract void | setHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)Sets the hostname verifier used by negotiate()
after the TLS handshake has completed and the default hostname
verification has failed.
setHostnameVerifier() must be called before
negotiate() is invoked for it to have effect.
If called after
negotiate(), this method does not do anything.
|