Package org.jivesoftware.openfire.net
Class TLSStreamHandler
java.lang.Object
org.jivesoftware.openfire.net.TLSStreamHandler
TLSStreamHandler is responsible for securing plain connections by negotiating TLS. By creating
a new instance of this class the plain connection will be encrypted.
- Author:
- Hao Chen
-
Constructor Summary
ConstructorsConstructorDescriptionTLSStreamHandler(Socket socket, ConnectionConfiguration configuration, boolean clientMode) Creates a new TLSStreamHandler and encrypt the plain socket connection. -
Method Summary
-
Constructor Details
-
TLSStreamHandler
public TLSStreamHandler(Socket socket, ConnectionConfiguration configuration, boolean clientMode) throws IOException Creates a new TLSStreamHandler and encrypt the plain socket connection. When connecting to a remote server thenclientModewill betrueandremoteServeris the server name of the remote server. OtherwiseclientModewill befalseandremoteServernull.- Parameters:
socket- the plain socket connection to encryptconfiguration- the configuration for the connectionclientMode- boolean indicating if this entity is a client or a server.- Throws:
IOException- if an exception occurs
-
-
Method Details
-
getInputStream
-
getOutputStream
-
start
- Throws:
IOException
-
close
Closes the channels that will end up closing the input and output streams of the connection. The channels implement the InterruptibleChannel interface so any other thread that was blocked in an I/O operation will be interrupted and will get an exception.- Throws:
IOException- if an I/O error occurs.
-
getSSLSession
Returns the SSLSession in use. The session specifies a particular cipher suite which is being actively used by all connections in that session, as well as the identities of the session's client and server.- Returns:
- the SSLSession in use.
-