Class SniHandler

  • All Implemented Interfaces:
    io.netty5.channel.ChannelHandler

    public class SniHandler
    extends AbstractSniHandler<SslContext>

    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.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.netty5.handler.codec.ByteToMessageDecoder

        io.netty5.handler.codec.ByteToMessageDecoder.Cumulator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected io.netty5.util.AsyncMapping<String,​SslContext> mapping  
      • Fields inherited from class io.netty5.handler.codec.ByteToMessageDecoder

        COMPOSITE_CUMULATOR, MERGE_CUMULATOR
    • Constructor Summary

      Constructors 
      Constructor Description
      SniHandler​(io.netty5.util.AsyncMapping<? super String,​? extends SslContext> mapping)
      Creates a SNI detection handler with configured SslContext maintained by AsyncMapping
      SniHandler​(io.netty5.util.DomainNameMapping<? extends SslContext> mapping)
      Creates a SNI detection handler with configured SslContext maintained by DomainNameMapping
      SniHandler​(io.netty5.util.Mapping<? super String,​? extends SslContext> mapping)
      Creates a SNI detection handler with configured SslContext maintained by Mapping
    • Field Detail

      • mapping

        protected final io.netty5.util.AsyncMapping<String,​SslContext> mapping
    • Constructor Detail

      • SniHandler

        public SniHandler​(io.netty5.util.Mapping<? super String,​? extends SslContext> mapping)
        Creates a SNI detection handler with configured SslContext maintained by Mapping
        Parameters:
        mapping - the mapping of domain name to SslContext
      • SniHandler

        public SniHandler​(io.netty5.util.DomainNameMapping<? extends SslContext> mapping)
        Creates a SNI detection handler with configured SslContext maintained by DomainNameMapping
        Parameters:
        mapping - the mapping of domain name to SslContext
      • SniHandler

        public SniHandler​(io.netty5.util.AsyncMapping<? super String,​? extends SslContext> mapping)
        Creates a SNI detection handler with configured SslContext maintained by AsyncMapping
        Parameters:
        mapping - the mapping of domain name to SslContext