Package org.dcache.xrootd.security
Class TLSSessionInfo
- java.lang.Object
-
- org.dcache.xrootd.security.TLSSessionInfo
-
public class TLSSessionInfo extends java.lang.ObjectUsed by both the server and the TPC client to determine when TLS should be activated. Automatically adds the SSLHandler to the pipeline when activate is true.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTLSSessionInfo.ClientTls
-
Constructor Summary
Constructors Constructor Description TLSSessionInfo(TLSSessionInfo other)TLSSessionInfo(ServerProtocolFlags serverFlags)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclientTransitionedToTLS(int request, io.netty.channel.ChannelHandlerContext ctx)This method should be called by the TPC client before the relevant requests.booleanclientUsesTls()voidcreateClientSession(boolean isTls)int[]getClientFlags()java.lang.StringgetClientTls()ServerProtocolFlagsgetLocalServerProtocolFlags()booleanisIncomingClientTLSCapable()static booleanisTLSOn(io.netty.channel.ChannelHandlerContext ctx)booleanserverTransitionedToTLS(int request, io.netty.channel.ChannelHandlerContext ctx)This method should be called by the server during the response to the relevant requests.booleanserverUsesTls()voidsetClientSslHandlerFactory(SSLHandlerFactory sslHandlerFactory)voidsetLocalTlsActivation(int version, int clientOptions, int clientExpect)Used by the server side to determine response to client, depending on its own configuration and the client flags.voidsetServerSslHandlerFactory(SSLHandlerFactory serverSslHandlerFactory)voidsetSourceServerFlags(int sourceServerFlags)Called by the TPC client.
-
-
-
Constructor Detail
-
TLSSessionInfo
public TLSSessionInfo(ServerProtocolFlags serverFlags)
-
TLSSessionInfo
public TLSSessionInfo(TLSSessionInfo other)
- Parameters:
other- to clone from
-
-
Method Detail
-
isTLSOn
public static boolean isTLSOn(io.netty.channel.ChannelHandlerContext ctx)
-
clientTransitionedToTLS
public boolean clientTransitionedToTLS(int request, io.netty.channel.ChannelHandlerContext ctx) throws XrootdExceptionThis method should be called by the TPC client before the relevant requests.- Parameters:
request- to be sent to the remote server.ctx- for access to pipeline.- Returns:
- whether the SSLHandler was added the pipeline.
- Throws:
XrootdException
-
clientUsesTls
public boolean clientUsesTls()
-
createClientSession
public void createClientSession(boolean isTls)
-
isIncomingClientTLSCapable
public boolean isIncomingClientTLSCapable()
-
setSourceServerFlags
public void setSourceServerFlags(int sourceServerFlags)
Called by the TPC client.- Parameters:
sourceServerFlags- from the protocol response
-
getClientFlags
public int[] getClientFlags()
-
getClientTls
public java.lang.String getClientTls()
-
getLocalServerProtocolFlags
public ServerProtocolFlags getLocalServerProtocolFlags()
-
serverTransitionedToTLS
public boolean serverTransitionedToTLS(int request, io.netty.channel.ChannelHandlerContext ctx) throws XrootdExceptionThis method should be called by the server during the response to the relevant requests.- Parameters:
request- to which the server is responding.ctx- for access to pipeline.- Returns:
- whether the SSLHandler was added the pipeline.
- Throws:
XrootdException
-
serverUsesTls
public boolean serverUsesTls()
-
setClientSslHandlerFactory
public void setClientSslHandlerFactory(SSLHandlerFactory sslHandlerFactory)
-
setLocalTlsActivation
public void setLocalTlsActivation(int version, int clientOptions, int clientExpect) throws XrootdExceptionUsed by the server side to determine response to client, depending on its own configuration and the client flags. This is called during the protocol request-response phase.- Parameters:
clientOptions- whether it supports or requests TLS.clientExpect- what the next request will be (optional).- Throws:
XrootdException
-
setServerSslHandlerFactory
public void setServerSslHandlerFactory(SSLHandlerFactory serverSslHandlerFactory)
-
-