public class SessionResumptionSslHandler
extends io.netty.channel.ChannelOutboundHandlerAdapter
The SSLEngine once created doesn't have context about connections or addresses,
but if host and port are specified at its creation, can use the session resumption feature.
This class just initialize the pipeline, adding the SSL handlers. It cannot be in the #initChannel of the PipelineInitializer, because when initiating the channel, we are not yet aware of the remote address. Only once connected we can know the remote address and create the SSLEngine with it to take advantage of the session resumption The class will initiate a SSL handshake upon the connection takes place.
| Modifier and Type | Field and Description |
|---|---|
static io.netty.util.AttributeKey<SessionResumptionSslHandler> |
CHANNEL_SESSION_RESUMPTION_HANDLER |
static java.lang.String |
PIPELINE_SESSION_RESUMPTION_HANDLER |
| Constructor and Description |
|---|
SessionResumptionSslHandler(io.netty.handler.ssl.SslContext sslContext,
boolean enableResumption,
int sslHandShakeTimeout) |
SessionResumptionSslHandler(javax.net.ssl.SSLContext sslContext,
javax.net.ssl.SSLParameters sslParameters,
boolean enableResumption,
int sslHandShakeTimeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(io.netty.channel.ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
io.netty.channel.ChannelPromise promise) |
bind, close, deregister, disconnect, flush, read, writeensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharablepublic static final java.lang.String PIPELINE_SESSION_RESUMPTION_HANDLER
public static final io.netty.util.AttributeKey<SessionResumptionSslHandler> CHANNEL_SESSION_RESUMPTION_HANDLER
public SessionResumptionSslHandler(io.netty.handler.ssl.SslContext sslContext,
boolean enableResumption,
int sslHandShakeTimeout)
sslContext - note that the type is SslContext (netty implementation) and not SSLContext (JDK implementation)public SessionResumptionSslHandler(javax.net.ssl.SSLContext sslContext,
javax.net.ssl.SSLParameters sslParameters,
boolean enableResumption,
int sslHandShakeTimeout)
sslContext - note that the type is SSLContext (JDK implementation) and not SslContext (netty implementation)public void connect(io.netty.channel.ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
io.netty.channel.ChannelPromise promise)
throws java.lang.Exception
connect in interface io.netty.channel.ChannelOutboundHandlerconnect in class io.netty.channel.ChannelOutboundHandlerAdapterjava.lang.Exception