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

public abstract Class SslClientHelloHandler<T>

extends ByteToMessageDecoder
Class Inheritance
Known Direct Subclasses
io.netty5.handler.ssl.AbstractSniHandler
Imports
io.netty5.buffer.BufferUtil, .Buffer, io.netty5.channel.ReadBufferAllocator, .ChannelHandlerContext, io.netty5.util.Resource, io.netty5.handler.codec.ByteToMessageDecoder, .DecoderException, io.netty5.util.concurrent.Future, io.netty5.util.internal.PlatformDependent, io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory

ByteToMessageDecoder which allows to be notified once a full ClientHello was received.

Field Summary

Modifier and TypeField and Description
private Buffer
private boolean
private static final InternalLogger
private ReadBufferAllocator
private boolean
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, Buffer
the Buffer from which to read data
in
)

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another.
protected void
handlerRemoved0(ChannelHandlerContext ctx)

Overrides io.netty5.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle events anymore.
protected abstract Future<T>
lookup(ChannelHandlerContext ctx, Buffer clientHello)

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 void
onLookupComplete(ChannelHandlerContext ctx, Future<? extends T> future)

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

public void
read(ChannelHandlerContext
the ChannelHandlerContext for which the read operation is made
ctx
,
ReadBufferAllocator
The ReadBufferAllocator that should be used to allocate a Buffer if needed (for reading the data).
readBufferAllocator
)

Overrides default io.netty5.channel.ChannelHandler.read.

Called once a read operation is made from the current registered EventLoop.
private void
private void
select(final ChannelHandlerContext ctx, Buffer clientHello)

Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
actualReadableByteschannelInactivechannelReadchannelReadCompletechannelShutdowndecodeLastdiscardSomeReadByteshandlerAddedhandlerAdded0handlerRemovedinternalBufferisSharableisSingleDecodesetSingleDecode

Field Detail

handshakeBufferback to summary
private Buffer handshakeBuffer
handshakeFailedback to summary
private boolean handshakeFailed
loggerback to summary
private static final InternalLogger logger
pendingReadBufferAllocatorback to summary
private ReadBufferAllocator pendingReadBufferAllocator
suppressReadback to summary
private boolean suppressRead

Constructor Detail

SslClientHelloHandlerback to summary
public SslClientHelloHandler()

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, Buffer in) throws Exception

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another. This method will be called till either the input Buffer has nothing to read when return from this method or till nothing was read from the input Buffer.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:Buffer

the Buffer from which to read data

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
handlerRemoved0back to summary
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception

Overrides io.netty5.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Doc from io.netty5.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle events anymore.

Annotations
@Override
lookupback to summary
protected abstract Future<T> lookup(ChannelHandlerContext ctx, Buffer clientHello) throws Exception

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;
See Also
onLookupComplete(ChannelHandlerContext, Future)
onLookupCompleteback to summary
protected abstract void onLookupComplete(ChannelHandlerContext ctx, Future<? extends T> future) throws Exception

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

See Also
lookup(ChannelHandlerContext, Buffer)
readback to summary
public void read(ChannelHandlerContext ctx, ReadBufferAllocator readBufferAllocator)

Overrides default io.netty5.channel.ChannelHandler.read.

Doc from io.netty5.channel.ChannelHandler.read.

Called once a read operation is made from the current registered EventLoop. If the ChannelHandler implementation queues the read and another read happens it is free to drop the first ReadBufferAllocator and just use the last one.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext for which the read operation is made

readBufferAllocator:ReadBufferAllocator

The ReadBufferAllocator that should be used to allocate a Buffer if needed (for reading the data).

Annotations
@Override
releaseHandshakeBufferback to summary
private void releaseHandshakeBuffer()
selectback to summary
private void select(final ChannelHandlerContext ctx, Buffer clientHello)