public abstract class AbstractSniHandler<T> extends SslClientHelloHandler<T>
Enables SNI (Server Name Indication) extension for server side SSL. For clients support SNI, the server could have multiple host name bound on a single IP. The client will send host name in the handshake data so server could decide which certificate to choose for the host name.
| Modifier and Type | Field and Description |
|---|---|
protected long |
handshakeTimeoutMillis |
MAX_CLIENT_HELLO_LENGTH| Modifier | Constructor and Description |
|---|---|
|
AbstractSniHandler() |
protected |
AbstractSniHandler(int maxClientHelloLength,
long handshakeTimeoutMillis) |
protected |
AbstractSniHandler(long handshakeTimeoutMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
protected io.netty.util.concurrent.Future<T> |
lookup(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf clientHello)
Kicks off a lookup for the given
ClientHello and returns a Future which in turn will
notify the SslClientHelloHandler.onLookupComplete(ChannelHandlerContext, Future) on completion. |
protected abstract io.netty.util.concurrent.Future<T> |
lookup(io.netty.channel.ChannelHandlerContext ctx,
String hostname)
Kicks off a lookup for the given SNI value and returns a
Future which in turn will
notify the onLookupComplete(ChannelHandlerContext, String, Future) on completion. |
protected void |
onLookupComplete(io.netty.channel.ChannelHandlerContext ctx,
io.netty.util.concurrent.Future<T> future)
Called upon completion of the
SslClientHelloHandler.lookup(ChannelHandlerContext, ByteBuf) Future. |
protected abstract void |
onLookupComplete(io.netty.channel.ChannelHandlerContext ctx,
String hostname,
io.netty.util.concurrent.Future<T> future)
Called upon completion of the
lookup(ChannelHandlerContext, String) Future. |
bind, close, connect, decode, deregister, disconnect, flush, handlerRemoved0, read, writeactualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtprotected AbstractSniHandler(long handshakeTimeoutMillis)
handshakeTimeoutMillis - the handshake timeout in millisecondsprotected AbstractSniHandler(int maxClientHelloLength,
long handshakeTimeoutMillis)
handshakeTimeoutMillis - the handshake timeout in millisecondspublic AbstractSniHandler()
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterExceptionpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionprotected io.netty.util.concurrent.Future<T> lookup(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf clientHello) throws Exception
SslClientHelloHandlerClientHello and returns a Future which in turn will
notify the SslClientHelloHandler.onLookupComplete(ChannelHandlerContext, Future) on completion.
See https://tools.ietf.org/html/rfc5246#section-7.4.1.2
struct {
ProtocolVersion client_version;
Random random;
SessionID session_id;
CipherSuite cipher_suites<2..2^16-2>;
CompressionMethod compression_methods<1..2^8-1>;
select (extensions_present) {
case false:
struct {};
case true:
Extension extensions<0..2^16-1>;
};
} ClientHello;
lookup in class SslClientHelloHandler<T>ExceptionSslClientHelloHandler.onLookupComplete(ChannelHandlerContext, Future)protected void onLookupComplete(io.netty.channel.ChannelHandlerContext ctx,
io.netty.util.concurrent.Future<T> future)
throws Exception
SslClientHelloHandlerSslClientHelloHandler.lookup(ChannelHandlerContext, ByteBuf) Future.onLookupComplete in class SslClientHelloHandler<T>ExceptionSslClientHelloHandler.lookup(ChannelHandlerContext, ByteBuf)protected abstract io.netty.util.concurrent.Future<T> lookup(io.netty.channel.ChannelHandlerContext ctx, String hostname) throws Exception
Future which in turn will
notify the onLookupComplete(ChannelHandlerContext, String, Future) on completion.ExceptiononLookupComplete(ChannelHandlerContext, String, Future)protected abstract void onLookupComplete(io.netty.channel.ChannelHandlerContext ctx,
String hostname,
io.netty.util.concurrent.Future<T> future)
throws Exception
lookup(ChannelHandlerContext, String) Future.Exceptionlookup(ChannelHandlerContext, String)Copyright © 2008–2025 The Netty Project. All rights reserved.