Create a default Client Mode SSLSocket.
Release this SSLSocket.
Reads from the underlying socket stream. If needed, setTimeout will set the max length of time the read will take before returning.
Used in conjuction with the above ctor with the create flag disabled. It is useful for accepting a new socket into a SSLSocket, and then re-using the Server's existing SSLCtx.
Shuts down the underlying socket for reading and writing.
Writes the passed buffer to the underlying socket stream. This will block until socket error.
see super.timeout(int)
Return the name of this device
Models a handle-oriented device.
Return the socket wrapper
Return a preferred size for buffering conduit I/O
Connect to the provided endpoint
Connect to the provided endpoint
Bind this socket. This is typically used to configure a listening socket (such as a server or multicast socket). The address given should describe a local adapter, or specify the port alone (ADDR_ANY) to have the OS assign a local adapter address.
Inform other end of a connected socket that we're no longer available. In general, this should be invoked before close()
Release this Socket
Read content from the socket. Note that the operation may timeout if method setTimeout() has been invoked with a non-zero value.
Transfer the content of another conduit to this one. Returns the dst OutputStream, or throws IOException on failure.
Manage socket IO under a timeout
Throw an IOException noting the last error
SSLSocket is a sub-class of Socket. It's purpose is to provide SSL encryption at the socket level as well as easily fit into existing Tango network applications that may already be using Socket.
SSLSocket requires the OpenSSL library, and uses a dynamic binding to the library. You can find the library at http://www.openssl.org and a Win32 specific port at http://www.slproweb.com/products/Win32OpenSSL.html.
SSLSockets have two modes:
1. Client mode, useful for connecting to existing servers, but not accepting new connections. Accepting a new connection will cause the library to stall on a write on connection.
2. Server mode, useful for creating an SSL server, but not connecting to an existing server. Connection will cause the library to stall on a read on connection.
Example SSL client