Package org.dcache.xrootd.plugins.tls
Class SSLHandlerFactory
- java.lang.Object
-
- org.dcache.xrootd.plugins.tls.SSLHandlerFactory
-
- All Implemented Interfaces:
ChannelHandlerFactory
public abstract class SSLHandlerFactory extends java.lang.Object implements ChannelHandlerFactory
Provides an SSLHandler constructed from the SSLContext established via properties. Each handler has a separate SSLEngine. The handler is always constructed in startTls mode, as it should not be added to the pipeline until ready to send the last unprotected response (server) or initiate the TLS handshake (client). Construction of the SSL Context is implementation specific, so a subclass of this class must be provided.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLIENT_TLSprotected java.lang.Stringnamestatic java.lang.StringSERVER_TLSprotected io.netty.handler.ssl.SslContextsslContextprotected booleanstartTls
-
Constructor Summary
Constructors Constructor Description SSLHandlerFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract io.netty.handler.ssl.SslContextbuildContext(java.util.Properties properties)Called by the provider during initialization.io.netty.channel.ChannelHandlercreateHandler()Creates a new channel handler.java.lang.StringgetDescription()Returns a human readable description of the channel handler plugin.static SSLHandlerFactorygetHandlerFactory(java.lang.String name, java.util.List<ChannelHandlerFactory> list)java.lang.StringgetName()Returns the name under which this plugin can be loaded.voidinitialize(java.util.Properties properties, boolean startTls)
-
-
-
Field Detail
-
SERVER_TLS
public static final java.lang.String SERVER_TLS
- See Also:
- Constant Field Values
-
CLIENT_TLS
public static final java.lang.String CLIENT_TLS
- See Also:
- Constant Field Values
-
sslContext
protected io.netty.handler.ssl.SslContext sslContext
-
startTls
protected boolean startTls
-
name
protected java.lang.String name
-
-
Method Detail
-
getHandlerFactory
public static SSLHandlerFactory getHandlerFactory(java.lang.String name, java.util.List<ChannelHandlerFactory> list)
-
initialize
public void initialize(java.util.Properties properties, boolean startTls) throws java.lang.Exception- Throws:
java.lang.Exception
-
getName
public java.lang.String getName()
Description copied from interface:ChannelHandlerFactoryReturns the name under which this plugin can be loaded.- Specified by:
getNamein interfaceChannelHandlerFactory
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ChannelHandlerFactoryReturns a human readable description of the channel handler plugin.- Specified by:
getDescriptionin interfaceChannelHandlerFactory
-
createHandler
public io.netty.channel.ChannelHandler createHandler()
Description copied from interface:ChannelHandlerFactoryCreates a new channel handler. The channel handler is only valid for a single connection.- Specified by:
createHandlerin interfaceChannelHandlerFactory- Returns:
- the new channel handler instance
-
buildContext
protected abstract io.netty.handler.ssl.SslContext buildContext(java.util.Properties properties) throws java.lang.ExceptionCalled by the provider during initialization.- Throws:
java.lang.Exception
-
-