Class NettyPipelineSslUtils
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.NettyPipelineSslUtils
-
public final class NettyPipelineSslUtils extends java.lang.Object
Utilities forChannelPipeline
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 theSSLSession
from theChannelPipeline
if theSslHandshakeCompletionEvent
is successful and reports the result toConnectionObserver.SecurityHandshakeObserver
if available.static boolean
isSslEnabled(io.netty.channel.ChannelPipeline pipeline)
Determine if theChannelPipeline
is configured for SSL/TLS.
-
-
-
Method Detail
-
isSslEnabled
public static boolean isSslEnabled(io.netty.channel.ChannelPipeline pipeline)
Determine if theChannelPipeline
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 theSSLSession
from theChannelPipeline
if theSslHandshakeCompletionEvent
is successful and reports the result toConnectionObserver.SecurityHandshakeObserver
if available.- Parameters:
pipeline
- theChannelPipeline
which contains handler containing theSSLSession
.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 toConnectionObserver.SecurityHandshakeObserver
.- Returns:
- The
SSLSession
ornull
if none can be found.
-
-