java.lang.Object | ||
↳ | java.net.Socket | |
↳ | javax.net.ssl.SSLSocket |
The extension of Socket
providing secure protocols like SSL (Secure
Socket Layer") or TLS (Transport Layer Security).
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Only to be used by subclasses.
| |||||||||||
Only to be used by subclasses.
| |||||||||||
Only to be used by subclasses.
| |||||||||||
Only to be used by subclasses.
| |||||||||||
Only to be used by subclasses.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Registers the specified listener to receive notification on completion of a
handshake on this connection.
| |||||||||||
Returns whether new SSL sessions may be created by this socket or if
existing sessions must be reused.
| |||||||||||
Returns the names of the enabled cipher suites.
| |||||||||||
Returns the names of the enabled protocols.
| |||||||||||
Returns whether this connection requires client authentication.
| |||||||||||
Returns the
SSLSession for this connection. | |||||||||||
Returns the names of the supported cipher suites.
| |||||||||||
Returns the names of the supported protocols.
| |||||||||||
Returns whether this connection will act in client mode when handshaking.
| |||||||||||
Returns whether this connections will request client authentication.
| |||||||||||
Removes the specified handshake completion listener.
| |||||||||||
Sets whether new SSL sessions may be created by this socket or if
existing sessions must be reused.
| |||||||||||
Sets the names of the cipher suites to be enabled.
| |||||||||||
Sets the names of the protocols to be enabled.
| |||||||||||
Sets whether this connection should require client authentication.
| |||||||||||
Sets whether this connection should act in client mode when handshaking.
| |||||||||||
Sets whether this connections should request client authentication.
| |||||||||||
Starts a new SSL handshake on this connection.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.net.Socket
| |||||||||||
From class java.lang.Object
|
Only to be used by subclasses.
Creates a TCP socket.
Only to be used by subclasses.
Creates a TCP socket connection to the specified host at the specified port.
host | the host name to connect to. |
---|---|
port | the port number to connect to. |
IOException | if creating the socket fails. |
---|---|
UnknownHostException | if the specified host is not known. |
Only to be used by subclasses.
Creates a TCP socket connection to the specified address at the specified port.
address | the address to connect to. |
---|---|
port | the port number to connect to. |
IOException | if creating the socket fails. |
---|
Only to be used by subclasses.
Creates a TCP socket connection to the specified host at the specified port with the client side bound to the specified address and port.
host | the host name to connect to. |
---|---|
port | the port number to connect to. |
clientAddress | the client address to bind to |
clientPort | the client port number to bind to. |
IOException | if creating the socket fails. |
---|---|
UnknownHostException | if the specified host is not known. |
Only to be used by subclasses.
Creates a TCP socket connection to the specified address at the specified port with the client side bound to the specified address and port.
address | the address to connect to. |
---|---|
port | the port number to connect to. |
clientAddress | the client address to bind to. |
clientPort | the client port number to bind to. |
IOException | if creating the socket fails. |
---|
Registers the specified listener to receive notification on completion of a handshake on this connection.
listener | the listener to register. |
---|
IllegalArgumentException | if listener is null . |
---|
Returns whether new SSL sessions may be created by this socket or if existing sessions must be reused.
true
if new sessions may be created, otherwise
false
.Returns the names of the enabled cipher suites.
Returns the names of the enabled protocols.
Returns whether this connection requires client authentication. This is only useful for sockets in server mode.
true
if client authentication is required, false
if no client authentication is needed.Returns the SSLSession
for this connection. If necessary, a
handshake will be initiated, in which case this method will block until the handshake
has been established. If the handshake fails, an invalid session object
will be returned.
Returns the names of the supported cipher suites.
Returns the names of the supported protocols.
Returns whether this connection will act in client mode when handshaking.
true
if this connections will act in client mode when
handshaking, false
if not.Returns whether this connections will request client authentication.
true
is client authentication will be requested,
false
if no client authentication is needed.Removes the specified handshake completion listener.
listener | the listener to remove. |
---|
IllegalArgumentException | if the specified listener is not registered or null . |
---|
Sets whether new SSL sessions may be created by this socket or if existing sessions must be reused.
flag | true if new sessions may be created, otherwise
false . |
---|
Sets the names of the cipher suites to be enabled. Only cipher suites returned by getSupportedCipherSuites() are allowed.
suites | the names of the to be enabled cipher suites. |
---|
IllegalArgumentException | if one of the cipher suite names is not supported. |
---|
Sets the names of the protocols to be enabled. Only protocols returned by getSupportedProtocols() are allowed.
protocols | the names of the to be enabled protocols. |
---|
IllegalArgumentException | if one of the protocols is not supported. |
---|
Sets whether this connection should require client authentication. This is only useful for sockets in server mode. The client authentication is one of the following:
need | true if client authentication is required,
false if no authentication is needed. |
---|
Sets whether this connection should act in client mode when handshaking.
mode | true if this connection should act in client mode,
false if not. |
---|
Sets whether this connections should request client authentication. This is only useful for sockets in server mode. The client authentication is one of:
want | true if client authentication should be requested,
false if not authentication is needed. |
---|
Starts a new SSL handshake on this connection.
IOException | if an error occurs. |
---|