Class GridNioSslFilter

    • Field Detail

      • HANDSHAKE_FUT_META_KEY

        public static final int HANDSHAKE_FUT_META_KEY
        SSL handshake future metadata key.
      • SSL_HANDSHAKE_DURATION_HISTOGRAM_METRIC_NAME

        public static final String SSL_HANDSHAKE_DURATION_HISTOGRAM_METRIC_NAME
        The name of the metric that provides histogram of SSL handshake duration.
        See Also:
        Constant Field Values
      • SSL_REJECTED_SESSIONS_CNT_METRIC_NAME

        public static final String SSL_REJECTED_SESSIONS_CNT_METRIC_NAME
        The name of the metric that provides sessions count that were rejected due to SSL errors.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GridNioSslFilter

        public GridNioSslFilter​(SSLContext sslCtx,
                                boolean directBuf,
                                ByteOrder order,
                                IgniteLogger log,
                                @Nullable
                                @Nullable MetricRegistryImpl mreg)
        Creates SSL filter.
        Parameters:
        sslCtx - SSL context.
        directBuf - Direct buffer flag.
        order - Byte order.
        log - Logger to use.
        mreg - Optional metric registry.
    • Method Detail

      • directMode

        public void directMode​(boolean directMode)
        Parameters:
        directMode - Flag indicating whether direct mode is used.
      • directMode

        public boolean directMode()
        Returns:
        Flag indicating whether direct mode is used.
      • wantClientAuth

        public void wantClientAuth​(boolean wantClientAuth)
        Sets flag indicating whether client authentication will be requested during handshake.
        Parameters:
        wantClientAuth - True if client authentication should be requested.
      • needClientAuth

        public void needClientAuth​(boolean needClientAuth)
        Sets flag indicating whether client authentication will be required.
        Parameters:
        needClientAuth - True if client authentication is required.
      • enabledCipherSuites

        public void enabledCipherSuites​(String... enabledCipherSuites)
        Sets a set of cipher suites that will be enabled for this filter.
        Parameters:
        enabledCipherSuites - Enabled cipher suites.
      • enabledProtocols

        public void enabledProtocols​(String... enabledProtos)
        Sets enabled secure protocols for this filter.
        Parameters:
        enabledProtos - Enabled protocols.
      • lock

        public boolean lock​(GridNioSession ses)
        Parameters:
        ses - Session.
        Returns:
        SSL handshake flag.
      • unlock

        public void unlock​(GridNioSession ses)
        Parameters:
        ses - NIO session.
      • onMessageReceived

        public void onMessageReceived​(GridNioSession ses,
                                      Object msg)
                               throws IgniteCheckedException
        Invoked when a new messages received.
        Parameters:
        ses - Session on which message was received.
        msg - Received message.
        Throws:
        IgniteCheckedException - If IgniteCheckedException occurred while handling event.
      • onSessionIdleTimeout

        public void onSessionIdleTimeout​(GridNioSession ses)
                                  throws IgniteCheckedException
        Called when session is idle for longer time that is allowed by NIO server.
        Parameters:
        ses - Session that is idle.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.
      • onSessionWriteTimeout

        public void onSessionWriteTimeout​(GridNioSession ses)
                                   throws IgniteCheckedException
        Called when session has not empty write buffer that has not been fully flushed during max timeout allowed by NIO server.
        Parameters:
        ses - Session that has timed out writes.
        Throws:
        IgniteCheckedException - If filter is not in chain or GridNioException occurred in the underlying filter.