Package org.xnio.channels

# Interface SslChannel

All Superinterfaces:
  `AutoCloseable`, `BoundChannel`, `Channel`, `Closeable`, `CloseableChannel`, `Configurable`, `ConnectedChannel`, `InterruptibleChannel`

All Known Subinterfaces:
  `ConnectedSslStreamChannel`

All Known Implementing Classes:
  `AssembledConnectedSslStreamChannel`, `AssembledSslChannel`, `JsseSslConnection`, `JsseSslStreamConnection`, `SslConnection`

public interface SslChannel extends ConnectedChannel
A channel which can use SSL/TLS to negotiate a security layer.

## Field Summary

### Fields inherited from interface org.xnio.channels.Configurable

`EMPTY`

## Method Summary

Modifier and Type
Method
Description
`ChannelListener.Setter<? extends SslChannel>`
`getCloseSetter()`
Get the setter which can be used to change the close listener for this channel.
`ChannelListener.Setter<? extends SslChannel>`
`getHandshakeSetter()`
Get the setter which can be used to change the handshake listener for this channel.
`SSLSession`
`getSslSession()`
Get the current `SSLSession` for this channel.
`void`
`startHandshake()`
Start or restart the SSL/TLS handshake.

### Methods inherited from interface org.xnio.channels.BoundChannel

`getLocalAddress, getLocalAddress`

### Methods inherited from interface java.nio.channels.Channel

`isOpen`

### Methods inherited from interface org.xnio.channels.CloseableChannel

`close, getIoThread, getWorker`

### Methods inherited from interface org.xnio.channels.Configurable

`getOption, setOption, supportsOption`

### Methods inherited from interface org.xnio.channels.ConnectedChannel

`getPeerAddress, getPeerAddress`

## Method Details

### startHandshake

void startHandshake() throws IOException
Start or restart the SSL/TLS handshake. To force a complete SSL/TLS session renegotiation, the current session should be invalidated prior to calling this method. This method is not needed for the initial handshake as sending or receiving over the channel will automatically initiate it.

Throws:
  `IOException` - if an I/O error occurs

### getSslSession

SSLSession getSslSession()
Get the current `SSLSession` for this channel.

Returns:
  the current `SSLSession`

### getCloseSetter

ChannelListener.Setter<? extends SslChannel> getCloseSetter()
Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Specified by:
  `getCloseSetter` in interface `BoundChannel`
Specified by:
  `getCloseSetter` in interface `CloseableChannel`
Specified by:
  `getCloseSetter` in interface `ConnectedChannel`
Returns:
  the setter

### getHandshakeSetter

ChannelListener.Setter<? extends SslChannel> getHandshakeSetter()
Get the setter which can be used to change the handshake listener for this channel.

Returns:
  the setter