javax.net.ssl
Class SSLSocket
Socket
|
+--javax.net.ssl.SSLSocket
public abstract class SSLSocket
extends Socket
A socket that communicates over the secure socket layer protocol.
SSLSocket()
|
SSLSocket(String host, int port)
|
SSLSocket(InetAddress address, int port)
|
SSLSocket(String host, int port, InetAddress localAddr, int localPort)
|
SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort)
|
SSLSocket
protected SSLSocket()
A socket that communicates over the secure socket layer protocol.
SSLSocket
protected SSLSocket(InetAddress address, int port)
Parameters:
SSLSocket
protected SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort)
Parameters:
SSLSocket
protected SSLSocket(String host, int port)
Parameters:
SSLSocket
protected SSLSocket(String host, int port, InetAddress localAddr, int localPort)
Parameters:
addHandshakeCompletedListener
public void addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener)
Adds a handshake completed listener that wants to be notified when the
SSL handshake completes.
Parameters:
getEnableSessionCreation
public boolean getEnableSessionCreation()
Returns whether or not sessions will be created by this socket, and thus
allow sessions to be continued later.
Returns:
- Whether or not sessions will be created.
getEnabledCipherSuites
public String[] getEnabledCipherSuites()
Returns the list of currently enabled cipher suites.
Returns:
- The list of enabled cipher suites.
getEnabledProtocols
public String[] getEnabledProtocols()
Returns the list of enabled SSL protocols.
Returns:
- The list of enabled protocols.
getNeedClientAuth
public boolean getNeedClientAuth()
Returns whether or not this socket will require connecting clients to
authenticate themselves. This value only applies to sockets in server
mode.
Returns:
- Whether or not this socket requires client authentication.
getSession
public SSLSession getSession()
Returns this socket's session object.
Returns:
getSupportedCipherSuites
public String[] getSupportedCipherSuites()
Returns the list of cipher suites supported by this socket.
Returns:
- The list of supported cipher suites.
getSupportedProtocols
public String[] getSupportedProtocols()
Returns the list of protocols supported by this socket.
Returns:
- The list of supported protocols.
getUseClientMode
public boolean getUseClientMode()
Returns whether or not this socket will connect in client mode.
Returns:
- True if this is a client socket.
getWantClientAuth
public boolean getWantClientAuth()
Returns whether or not this socket will request that connecting clients
authenticate themselves. This value only applies to sockets in server
mode.
Returns:
- The want client auth value.
removeHandshakeCompletedListener
public void removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener)
Removes a handshake listener from this socket.
Parameters:
setEnableSessionCreation
public void setEnableSessionCreation(boolean enable)
Sets whether or not sessions will be created by this socket.
Parameters:
setEnabledCipherSuites
public void setEnabledCipherSuites(String[] suites)
Sets the list of enabled cipher suites.
Parameters:
setEnabledProtocols
public void setEnabledProtocols(String[] protocols)
Sets the list of enabled SSL protocols.
Parameters:
setNeedClientAuth
public void setNeedClientAuth(boolean needAuth)
Sets whether or not this socket will require connecting clients to
authenticate themselves. This value only applies to sockets in server
mode.
Parameters:
setUseClientMode
public void setUseClientMode(boolean clientMode)
Sets whether or not this socket will connect in client mode.
Parameters:
setWantClientAuth
public void setWantClientAuth(boolean wantAuth)
Sets whether or not this socket will request that connecting clients
authenticate themselves. This value only applies to sockets in server
mode.
Parameters:
startHandshake
public void startHandshake()
Explicitly begins the handshake, or, if the handshake has already
completed, requests that the handshake be repeated.
The handshake will begin implicitly when any attempt to read or
write to the socket is made.
Throws:
- If an I/O or SSL error occurs.