Package org.apache.cassandra.auth
Class MutualTlsInternodeAuthenticator
java.lang.Object
org.apache.cassandra.auth.MutualTlsInternodeAuthenticator
- All Implemented Interfaces:
IInternodeAuthenticator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.auth.IInternodeAuthenticator
IInternodeAuthenticator.InternodeConnectionDirection -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(InetAddress remoteAddress, int remotePort) Decides whether or not a peer is allowed to connect to this node.booleanauthenticate(InetAddress remoteAddress, int remotePort, Certificate[] certificates, IInternodeAuthenticator.InternodeConnectionDirection connectionType) Decides whether a peer is allowed to connect to this node.protected booleanauthenticateInternodeWithMtls(InetAddress remoteAddress, int remotePort, Certificate[] certificates, IInternodeAuthenticator.InternodeConnectionDirection connectionType) voidValidates configuration of IInternodeAuthenticator implementation (if configurable).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.auth.IInternodeAuthenticator
setupInternode
-
Constructor Details
-
MutualTlsInternodeAuthenticator
-
-
Method Details
-
authenticate
Description copied from interface:IInternodeAuthenticatorDecides whether or not a peer is allowed to connect to this node. If this method returns false, the socket will be immediately closed.- Specified by:
authenticatein interfaceIInternodeAuthenticator- Parameters:
remoteAddress- ip address of the connecting node.remotePort- port of the connecting node.- Returns:
- true if the connection should be accepted, false otherwise.
-
authenticate
public boolean authenticate(InetAddress remoteAddress, int remotePort, Certificate[] certificates, IInternodeAuthenticator.InternodeConnectionDirection connectionType) Description copied from interface:IInternodeAuthenticatorDecides whether a peer is allowed to connect to this node. If this method returns false, the socket will be immediately closed.Default implementation calls authenticate method by IP and port method
1. If it is IP based authentication ignore the certificates & connectionType parameters in the implementation of this method. 2. For certificate based authentication like mTLS, server's identity for outbound connections is verified by the trusted root certificates in the outbound_keystore. In such cases this method may be overridden to return true when certificateType is OUTBOUND, as the authentication of the server happens during SSL Handshake.
- Specified by:
authenticatein interfaceIInternodeAuthenticator- Parameters:
remoteAddress- ip address of the connecting node.remotePort- port of the connecting node.certificates- peer certificatesconnectionType- If the connection is inbound/outbound connection.- Returns:
- true if the connection should be accepted, false otherwise.
-
validateConfiguration
Description copied from interface:IInternodeAuthenticatorValidates configuration of IInternodeAuthenticator implementation (if configurable).- Specified by:
validateConfigurationin interfaceIInternodeAuthenticator- Throws:
ConfigurationException- when there is a configuration error.
-
authenticateInternodeWithMtls
protected boolean authenticateInternodeWithMtls(InetAddress remoteAddress, int remotePort, Certificate[] certificates, IInternodeAuthenticator.InternodeConnectionDirection connectionType)
-