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 javax.net.ssl.SSLContext sslContext  
      protected boolean startTls  
    • Field Detail

      • sslContext

        protected javax.net.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 javax.net.ssl.SSLContext buildContext​(java.util.Properties properties)
                                                          throws java.lang.Exception
        Called by the provider during initialization.
        Throws:
        java.lang.Exception