Class SniHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

    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.

    • Field Detail

      • mapping

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

      • SniHandler

        public SniHandler​(io.netty.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.netty.util.Mapping<? super String,​? extends SslContext> mapping,
                          int maxClientHelloLength,
                          long handshakeTimeoutMillis)
        Creates a SNI detection handler with configured SslContext maintained by Mapping
        Parameters:
        mapping - the mapping of domain name to SslContext
        maxClientHelloLength - the maximum length of the client hello message
        handshakeTimeoutMillis - the handshake timeout in milliseconds
      • SniHandler

        public SniHandler​(io.netty.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.netty.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
      • SniHandler

        public SniHandler​(io.netty.util.AsyncMapping<? super String,​? extends SslContext> mapping,
                          int maxClientHelloLength,
                          long handshakeTimeoutMillis)
        Creates a SNI detection handler with configured SslContext maintained by AsyncMapping
        Parameters:
        mapping - the mapping of domain name to SslContext
        maxClientHelloLength - the maximum length of the client hello message
        handshakeTimeoutMillis - the handshake timeout in milliseconds
      • SniHandler

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

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