Package com.linkedin.alpini.netty4.ssl
Class SslClientInitializer
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
com.linkedin.alpini.netty4.handlers.ChannelInitializer<io.netty.channel.Channel>
com.linkedin.alpini.netty4.ssl.SslClientInitializer
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
Created by acurtis on 9/7/17.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
ConstructorDescriptionSslClientInitializer
(SSLEngineFactory sslEngineComponentFactory) SslClientInitializer
(SSLEngineFactory sslEngineComponentFactory, boolean principalValidation) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
clientCertificateValidation
(io.netty.channel.ChannelHandlerContext ctx, X509Certificate clientCert) enableSslTaskExecutor
(Executor executor) Configure for enabling the SslHandler to offload handshake compute tasks to an alternate executor.protected void
initChannel
(io.netty.channel.Channel ch) This method will be called once theChannel
was registered.Methods inherited from class com.linkedin.alpini.netty4.handlers.ChannelInitializer
channelRegistered, currentContext, exceptionCaught, handlerAdded, handlerRemoved
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
SslClientInitializer
-
SslClientInitializer
public SslClientInitializer(SSLEngineFactory sslEngineComponentFactory, boolean principalValidation)
-
-
Method Details
-
enableSslTaskExecutor
Configure for enabling the SslHandler to offload handshake compute tasks to an alternate executor.- Parameters:
executor
- Executor to perform SslHandler tasks- Returns:
- this
-
clientCertificateValidation
protected boolean clientCertificateValidation(io.netty.channel.ChannelHandlerContext ctx, X509Certificate clientCert) -
initChannel
Description copied from class:ChannelInitializer
This method will be called once theChannel
was registered. After the method returns this instance will be removed from theChannelPipeline
of theChannel
.- Specified by:
initChannel
in classChannelInitializer<io.netty.channel.Channel>
- Parameters:
ch
- theChannel
which was registered.- Throws:
Exception
- is thrown if an error occurs. In that case it will be handled byChannelInitializer.exceptionCaught(ChannelHandlerContext, Throwable)
which will by default close theChannel
.
-