Class NettyPipelineSslUtils


  • public final class NettyPipelineSslUtils
    extends java.lang.Object
    Utilities for ChannelPipeline and SSL/TLS.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.net.ssl.SSLSession extractSslSessionAndReport​(io.netty.channel.ChannelPipeline pipeline, io.netty.handler.ssl.SslHandshakeCompletionEvent sslEvent, java.util.function.Consumer<java.lang.Throwable> failureConsumer, boolean shouldReport)
      Extracts the SSLSession from the ChannelPipeline if the SslHandshakeCompletionEvent is successful and reports the result to ConnectionObserver.SecurityHandshakeObserver if available.
      static boolean isSslEnabled​(io.netty.channel.ChannelPipeline pipeline)
      Determine if the ChannelPipeline is configured for SSL/TLS.
      • Methods inherited from class java.lang.Object

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

      • isSslEnabled

        public static boolean isSslEnabled​(io.netty.channel.ChannelPipeline pipeline)
        Determine if the ChannelPipeline is configured for SSL/TLS.
        Parameters:
        pipeline - The pipeline to check.
        Returns:
        true if the pipeline is configured to use SSL/TLS.
      • extractSslSessionAndReport

        @Nullable
        public static javax.net.ssl.SSLSession extractSslSessionAndReport​(io.netty.channel.ChannelPipeline pipeline,
                                                                          io.netty.handler.ssl.SslHandshakeCompletionEvent sslEvent,
                                                                          java.util.function.Consumer<java.lang.Throwable> failureConsumer,
                                                                          boolean shouldReport)
        Extracts the SSLSession from the ChannelPipeline if the SslHandshakeCompletionEvent is successful and reports the result to ConnectionObserver.SecurityHandshakeObserver if available.
        Parameters:
        pipeline - the ChannelPipeline which contains handler containing the SSLSession.
        sslEvent - the event indicating a SSL/TLS handshake completed.
        failureConsumer - invoked if a failure is encountered.
        shouldReport - true if the handshake status should be reported to ConnectionObserver.SecurityHandshakeObserver.
        Returns:
        The SSLSession or null if none can be found.