public class TLSStreamHandler extends Object
Constructor and Description |
---|
TLSStreamHandler(Connection connection,
Socket socket,
boolean clientMode,
String remoteServer,
boolean needClientAuth)
Creates a new TLSStreamHandler and secures the plain socket connection.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the channels that will end up closing the input and output streams of the connection.
|
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
SSLSession |
getSSLSession()
Returns the SSLSession in use.
|
public TLSStreamHandler(Connection connection, Socket socket, boolean clientMode, String remoteServer, boolean needClientAuth) throws IOException
true
and
remoteServer is the server name of the remote server. Otherwise clientMode
will be false
and remoteServer null.connection
- the connection to securesocket
- the plain socket connection to secureclientMode
- boolean indicating if this entity is a client or a server.remoteServer
- server name of the remote server we are connecting to or null
when not in client mode.needClientAuth
- boolean that indicates if client should authenticate during the TLS
negotiation. This option is only required when the client is a server since
EXTERNAL SASL is going to be used.IOException
public InputStream getInputStream()
public OutputStream getOutputStream()
public void close() throws IOException
IOException
- if an I/O error occurs.public SSLSession getSSLSession()
Copyright © 2003-2008 Jive Software.