Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
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.

Constructor Summary

SSLSocket()

A socket that communicates over the secure socket layer protocol.
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)

Method Summary

voidaddHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener)

Adds a handshake completed listener that wants to be notified when the SSL handshake completes.
booleangetEnableSessionCreation()

Returns whether or not sessions will be created by this socket, and thus allow sessions to be continued later.
String[]getEnabledCipherSuites()

Returns the list of currently enabled cipher suites.
String[]getEnabledProtocols()

Returns the list of enabled SSL protocols.
booleangetNeedClientAuth()

Returns whether or not this socket will require connecting clients to authenticate themselves.
javax.net.ssl.SSLSessiongetSession()

Returns this socket's session object.
String[]getSupportedCipherSuites()

Returns the list of cipher suites supported by this socket.
String[]getSupportedProtocols()

Returns the list of protocols supported by this socket.
booleangetUseClientMode()

Returns whether or not this socket will connect in client mode.
booleangetWantClientAuth()

Returns whether or not this socket will request that connecting clients authenticate themselves.
voidremoveHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener)

Removes a handshake listener from this socket.
voidsetEnableSessionCreation(boolean enable)

Sets whether or not sessions will be created by this socket.
voidsetEnabledCipherSuites(String[] suites)

Sets the list of enabled cipher suites.
voidsetEnabledProtocols(String[] protocols)

Sets the list of enabled SSL protocols.
voidsetNeedClientAuth(boolean needAuth)

Sets whether or not this socket will require connecting clients to authenticate themselves.
voidsetUseClientMode(boolean clientMode)

Sets whether or not this socket will connect in client mode.
voidsetWantClientAuth(boolean wantAuth)

Sets whether or not this socket will request that connecting clients authenticate themselves.
voidstartHandshake()

Explicitly begins the handshake, or, if the handshake has already completed, requests that the handshake be repeated.

Constructor Details

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:


Method Details

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:


getEnabledCipherSuites

public String[] getEnabledCipherSuites()

Returns the list of currently enabled cipher suites.

Returns:


getEnabledProtocols

public String[] getEnabledProtocols()

Returns the list of enabled SSL protocols.

Returns:


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:


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:


getSupportedProtocols

public String[] getSupportedProtocols()

Returns the list of protocols supported by this socket.

Returns:


getUseClientMode

public boolean getUseClientMode()

Returns whether or not this socket will connect in client mode.

Returns:


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:


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: