Class SSLEngineConfigurator

    • Field Detail

      • sslContext

        protected volatile SSLContext sslContext
      • enabledCipherSuites

        protected String[] enabledCipherSuites
        The list of cipher suite
      • enabledProtocols

        protected String[] enabledProtocols
        the list of protocols
      • clientMode

        protected boolean clientMode
        Client mode when handshaking.
      • needClientAuth

        protected boolean needClientAuth
        Require client Authentication.
      • wantClientAuth

        protected boolean wantClientAuth
        True when requesting authentication.
    • Constructor Detail

      • SSLEngineConfigurator

        public SSLEngineConfigurator​(SSLContext sslContext)
        Create SSL Engine configuration basing on passed SSLContext.
        Parameters:
        sslContext - SSLContext.
      • SSLEngineConfigurator

        public SSLEngineConfigurator​(SSLContext sslContext,
                                     boolean clientMode,
                                     boolean needClientAuth,
                                     boolean wantClientAuth)
        Create SSL Engine configuration basing on passed SSLContext, using passed client mode, need/want client auth parameters.
        Parameters:
        sslContext - SSLContext.
        clientMode -
        needClientAuth -
        wantClientAuth -
      • SSLEngineConfigurator

        public SSLEngineConfigurator​(SSLContextConfigurator sslContextConfiguration,
                                     boolean clientMode,
                                     boolean needClientAuth,
                                     boolean wantClientAuth)
        Create SSL Engine configuration basing on passed SSLContextConfigurator. This constructor makes possible to initialize SSLEngine and SSLContext in lazy fashion on first createSSLEngine() call.
        Parameters:
        sslContextConfiguration - SSLContextConfigurator.
        clientMode -
        needClientAuth -
        wantClientAuth -
      • SSLEngineConfigurator

        protected SSLEngineConfigurator()
    • Method Detail

      • createSSLEngine

        public SSLEngine createSSLEngine()
        Create and configure SSLEngine using this context configuration.
        Returns:
        SSLEngine.
      • createSSLEngine

        public SSLEngine createSSLEngine​(String peerHost,
                                         int peerPort)
        Create and configure SSLEngine using this context configuration using advisory peer information.

        Applications using this factory method are providing hints for an internal session reuse strategy.

        Some cipher suites (such as Kerberos) require remote hostname information, in which case peerHost needs to be specified.

        Specified by:
        createSSLEngine in interface SSLEngineFactory
        Parameters:
        peerHost - the non-authoritative name of the host
        peerPort - the non-authoritative port
        Returns:
        SSLEngine.
      • isClientMode

        public boolean isClientMode()
        Will SSLEngine be configured to work in client mode.
        Returns:
        true, if SSLEngine will be configured to work in client mode, or false for server mode.
      • setClientMode

        public SSLEngineConfigurator setClientMode​(boolean clientMode)
        Set SSLEngine to be configured to work in client mode.
        Parameters:
        clientMode - true, if SSLEngine will be configured to work in client mode, or false for server mode.
        Returns:
        this SSLEngineConfigurator
      • isNeedClientAuth

        public boolean isNeedClientAuth()
      • isWantClientAuth

        public boolean isWantClientAuth()
      • getEnabledCipherSuites

        public String[] getEnabledCipherSuites()
        Returns:
        an array of enabled cipher suites. Modifications made on the array content won't be propagated to SSLEngineConfigurator
      • setEnabledCipherSuites

        public SSLEngineConfigurator setEnabledCipherSuites​(String[] enabledCipherSuites)
        Sets a list of enabled cipher suites. Note: further modifications made on the passed array won't be propagated to SSLEngineConfigurator.
        Parameters:
        enabledCipherSuites - list of enabled cipher suites
        Returns:
        this SSLEngineConfigurator
      • getEnabledProtocols

        public String[] getEnabledProtocols()
        Returns:
        an array of enabled protocols. Modifications made on the array content won't be propagated to SSLEngineConfigurator
      • setEnabledProtocols

        public SSLEngineConfigurator setEnabledProtocols​(String[] enabledProtocols)
        Sets a list of enabled protocols. Note: further modifications made on the passed array won't be propagated to SSLEngineConfigurator.
        Parameters:
        enabledProtocols - list of enabled protocols
        Returns:
        this SSLEngineConfigurator
      • isCipherConfigured

        public boolean isCipherConfigured()
      • isProtocolConfigured

        public boolean isProtocolConfigured()
      • setProtocolConfigured

        public SSLEngineConfigurator setProtocolConfigured​(boolean isProtocolConfigured)
      • getSslContext

        public SSLContext getSslContext()