Class SSLHandlerFactory

  • All Implemented Interfaces:
    ChannelHandlerFactory

    public abstract class SSLHandlerFactory
    extends java.lang.Object
    implements ChannelHandlerFactory
    Provides an SSLHandler constructed from the SSLContext established via properties. Each handler has a separate SSLEngine. The handler is always constructed in startTls mode, as it should not be added to the pipeline until ready to send the last unprotected response (server) or initiate the TLS handshake (client).

    Construction of the SSL Context is implementation specific, so a subclass of this class must be provided.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CLIENT_TLS  
      protected java.lang.String name  
      static java.lang.String SERVER_TLS  
      protected io.netty.handler.ssl.SslContext sslContext  
      protected boolean startTls  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract io.netty.handler.ssl.SslContext buildContext​(java.util.Properties properties)
      Called by the provider during initialization.
      io.netty.channel.ChannelHandler createHandler()
      Creates a new channel handler.
      java.lang.String getDescription()
      Returns a human readable description of the channel handler plugin.
      static SSLHandlerFactory getHandlerFactory​(java.lang.String name, java.util.List<ChannelHandlerFactory> list)  
      java.lang.String getName()
      Returns the name under which this plugin can be loaded.
      void initialize​(java.util.Properties properties, boolean startTls)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sslContext

        protected io.netty.handler.ssl.SslContext sslContext
      • startTls

        protected boolean startTls
      • name

        protected java.lang.String name
    • Constructor Detail

      • SSLHandlerFactory

        public SSLHandlerFactory()
    • Method Detail

      • initialize

        public void initialize​(java.util.Properties properties,
                               boolean startTls)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createHandler

        public io.netty.channel.ChannelHandler createHandler()
        Description copied from interface: ChannelHandlerFactory
        Creates a new channel handler. The channel handler is only valid for a single connection.
        Specified by:
        createHandler in interface ChannelHandlerFactory
        Returns:
        the new channel handler instance
      • buildContext

        protected abstract io.netty.handler.ssl.SslContext buildContext​(java.util.Properties properties)
                                                                 throws java.lang.Exception
        Called by the provider during initialization.
        Throws:
        java.lang.Exception