- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.ByteToMessageDecoderForBuffer
-
- io.netty5.handler.ssl.SslClientHelloHandler<T>
-
- io.netty5.handler.ssl.AbstractSniHandler<T>
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
- Direct Known Subclasses:
SniHandler
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.
-
-
Constructor Summary
Constructors Constructor Description AbstractSniHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected io.netty5.util.concurrent.Future<T>
lookup(io.netty5.channel.ChannelHandlerContext ctx, io.netty5.buffer.api.Buffer clientHello)
Kicks off a lookup for the givenClientHello
and returns aFuture
which in turn will notify theSslClientHelloHandler.onLookupComplete(ChannelHandlerContext, Future)
on completion.protected abstract io.netty5.util.concurrent.Future<T>
lookup(io.netty5.channel.ChannelHandlerContext ctx, String hostname)
Kicks off a lookup for the given SNI value and returns aFuture
which in turn will notify theonLookupComplete(ChannelHandlerContext, String, Future)
on completion.protected void
onLookupComplete(io.netty5.channel.ChannelHandlerContext ctx, io.netty5.util.concurrent.Future<? extends T> future)
Called upon completion of theSslClientHelloHandler.lookup(ChannelHandlerContext, Buffer)
Future
.protected abstract void
onLookupComplete(io.netty5.channel.ChannelHandlerContext ctx, String hostname, io.netty5.util.concurrent.Future<? extends T> future)
Called upon completion of thelookup(ChannelHandlerContext, String)
Future
.-
Methods inherited from class io.netty5.handler.ssl.SslClientHelloHandler
decode, handlerRemoved0, read
-
Methods inherited from class io.netty5.handler.codec.ByteToMessageDecoderForBuffer
actualReadableBytes, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerAdded, handlerAdded0, handlerRemoved, internalBuffer, isSingleDecode, setSingleDecode, userEventTriggered
-
-
-
-
Method Detail
-
lookup
protected io.netty5.util.concurrent.Future<T> lookup(io.netty5.channel.ChannelHandlerContext ctx, io.netty5.buffer.api.Buffer clientHello) throws Exception
Description copied from class:SslClientHelloHandler
Kicks off a lookup for the givenClientHello
and returns aFuture
which in turn will notify theSslClientHelloHandler.onLookupComplete(ChannelHandlerContext, Future)
on completion. See https://tools.ietf.org/html/rfc5246#section-7.4.1.2struct { 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;
- Specified by:
lookup
in classSslClientHelloHandler<T>
- Throws:
Exception
- See Also:
SslClientHelloHandler.onLookupComplete(ChannelHandlerContext, Future)
-
onLookupComplete
protected void onLookupComplete(io.netty5.channel.ChannelHandlerContext ctx, io.netty5.util.concurrent.Future<? extends T> future) throws Exception
Description copied from class:SslClientHelloHandler
Called upon completion of theSslClientHelloHandler.lookup(ChannelHandlerContext, Buffer)
Future
.- Specified by:
onLookupComplete
in classSslClientHelloHandler<T>
- Throws:
Exception
- See Also:
SslClientHelloHandler.lookup(ChannelHandlerContext, Buffer)
-
lookup
protected abstract io.netty5.util.concurrent.Future<T> lookup(io.netty5.channel.ChannelHandlerContext ctx, String hostname) throws Exception
Kicks off a lookup for the given SNI value and returns aFuture
which in turn will notify theonLookupComplete(ChannelHandlerContext, String, Future)
on completion.- Throws:
Exception
- See Also:
onLookupComplete(ChannelHandlerContext, String, Future)
-
onLookupComplete
protected abstract void onLookupComplete(io.netty5.channel.ChannelHandlerContext ctx, String hostname, io.netty5.util.concurrent.Future<? extends T> future) throws Exception
Called upon completion of thelookup(ChannelHandlerContext, String)
Future
.- Throws:
Exception
- See Also:
lookup(ChannelHandlerContext, String)
-
-