Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.9.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.net
Class TLSStreamHandler

    java.lang.Object
      org.jivesoftware.openfire.net.TLSStreamHandler

    public class TLSStreamHandler

extends Object

TLSStreamHandler is responsible for securing plain connections by negotiating TLS. By creating a new instance of this class the plain connection will be secured.

Author:
  Hao Chen

Constructor Summary
`TLSStreamHandler(Connection connection, Socket socket, boolean clientMode, String remoteServer, boolean needClientAuth)` Creates a new TLSStreamHandler and secures the plain socket connection.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TLSStreamHandler

    public TLSStreamHandler(Connection connection,
                            Socket socket,
                            boolean clientMode,
                            String remoteServer,
                            boolean needClientAuth)
                     throws IOException

  Creates a new TLSStreamHandler and secures the plain socket connection. When connecting to a remote server then `clientMode` will be `true` and `remoteServer` is the server name of the remote server. Otherwise `clientMode` will be `false` and `remoteServer` null.

  Parameters:
    `connection` - the connection to secure
    `socket` - the plain socket connection to secure
    `clientMode` - 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.
  Throws:
    `IOException`

Method Detail

### getInputStream

    public InputStream getInputStream()

### getOutputStream

    public OutputStream getOutputStream()

### close

    public void close()
               throws IOException

  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

    public SSLSession 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.9.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.