Top Description Fields Constructors Methods
io.netty5.handler.ssl

public abstract Class AbstractSniHandler<T>

extends SslClientHelloHandler<T>
Class Inheritance
Known Direct Subclasses
io.netty5.handler.ssl.SniHandler
Imports
io.netty5.buffer.Buffer, io.netty5.buffer.internal.InternalBufferUtils, io.netty5.channel.ChannelHandlerContext, io.netty5.util.concurrent.Future, java.nio.charset.StandardCharsets, java.util.Locale

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.

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String
private static void
protected Future<T>
lookup(ChannelHandlerContext ctx, Buffer clientHello)

Implements abstract io.netty5.handler.ssl.SslClientHelloHandler.lookup.

Kicks off a lookup for the given ClientHello and returns a Future which in turn will notify the onLookupComplete(ChannelHandlerContext, Future) on completion.
protected abstract Future<T>
lookup(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
protected abstract void
onLookupComplete(ChannelHandlerContext ctx, String hostname, Future<? extends T> future)

Called upon completion of the lookup(ChannelHandlerContext, String) Future.

Inherited from io.netty5.handler.ssl.SslClientHelloHandler:
decodehandlerRemoved0read

Field Detail

hostnameback to summary
private String hostname

Constructor Detail

AbstractSniHandlerback to summary
public AbstractSniHandler()

Method Detail

extractSniHostnameback to summary
private static String extractSniHostname(Buffer in)
fireSniCompletionEventback to summary
private static void fireSniCompletionEvent(ChannelHandlerContext ctx, String hostname, Future<?> future)
lookupback to summary
protected Future<T> lookup(ChannelHandlerContext ctx, Buffer clientHello) throws Exception

Implements abstract io.netty5.handler.ssl.SslClientHelloHandler.lookup.

Doc from io.netty5.handler.ssl.SslClientHelloHandler.lookup.

Kicks off a lookup for the given ClientHello and returns a Future which in turn will notify the 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;
Annotations
@Override
lookupback to summary
protected abstract Future<T> lookup(ChannelHandlerContext ctx, String hostname) throws Exception

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.

See Also
onLookupComplete(ChannelHandlerContext, String, Future)
onLookupCompleteback to summary
protected void onLookupComplete(ChannelHandlerContext ctx, Future<? extends T> future) throws Exception

Implements abstract io.netty5.handler.ssl.SslClientHelloHandler.onLookupComplete.

Doc from io.netty5.handler.ssl.SslClientHelloHandler.onLookupComplete.

Called upon completion of the lookup(ChannelHandlerContext, Buffer) Future.

Annotations
@Override
onLookupCompleteback to summary
protected abstract void onLookupComplete(ChannelHandlerContext ctx, String hostname, Future<? extends T> future) throws Exception

Called upon completion of the lookup(ChannelHandlerContext, String) Future.

See Also
lookup(ChannelHandlerContext, String)