Package org.apache.cassandra.config
Class EncryptionOptions
java.lang.Object
org.apache.cassandra.config.EncryptionOptions
- Direct Known Subclasses:
EncryptionOptions.ServerEncryptionOptions
This holds various options used for enabling SSL/TLS encryption.
Examples of such options are: supported cipher-suites, ssl protocol with version, accepted protocols, end-point
verification, require client-auth/cert etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEncryptionOptions(EncryptionOptions options) EncryptionOptions(ParameterizedClass ssl_context_factory, String keystore, String keystore_password, String truststore, String truststore_password, List<String> cipher_suites, String protocol, List<String> accepted_protocols, String algorithm, String store_type, boolean require_client_auth, boolean require_endpoint_verification, Boolean enabled, Boolean optional) -
Method Summary
Modifier and TypeMethodDescriptionString[]String[]booleanThe method is being mainly used to cache SslContexts therefore, we only consider fields that would make a difference when the TrustStore or KeyStore files are updatedprotected voidfillSslContextParams(Map<String, Object> sslContextFactoryParameters) Indicates if the channel should be encrypted.Indicates if the channel may be encrypted (but is not required to be).inthashCode()The method is being mainly used to cache SslContexts therefore, we only consider fields that would make a difference when the TrustStore or KeyStore files are updatedprotected static voidputSslContextFactoryParameter(Map<String, Object> existingParameters, EncryptionOptions.ConfigKey configKey, Object value) voidsetAcceptedProtocols(List<String> accepted_protocols) Sets accepted TLS protocols for this channel.voidsetEnabled(Boolean enabled) Sets if encryption should be enabled for this channel.voidsetOptional(Boolean optional) Sets if encryption should be optional for this channel.voidsetProtocol(String protocol) Sets accepted TLS protocol for this channel.withAcceptedProtocols(List<String> accepted_protocols) withAlgorithm(String algorithm) withCipherSuites(String... cipher_suites) withCipherSuites(List<String> cipher_suites) withEnabled(boolean enabled) withKeyStore(String keystore) withKeyStorePassword(String keystore_password) withOptional(Boolean optional) withProtocol(String protocol) withRequireClientAuth(boolean require_client_auth) withRequireEndpointVerification(boolean require_endpoint_verification) withSslContextFactory(ParameterizedClass sslContextFactoryClass) withStoreType(String store_type) withTrustStore(String truststore) withTrustStorePassword(String truststore_password)
-
Field Details
-
ssl_context_factory
-
keystore
-
keystore_password
-
truststore
-
truststore_password
-
cipher_suites
-
protocol
-
accepted_protocols
-
algorithm
-
store_type
-
require_client_auth
public final boolean require_client_auth -
require_endpoint_verification
public final boolean require_endpoint_verification -
enabled
-
optional
-
isEnabled
-
isOptional
-
sslContextFactoryInstance
-
-
Constructor Details
-
EncryptionOptions
public EncryptionOptions() -
EncryptionOptions
public EncryptionOptions(ParameterizedClass ssl_context_factory, String keystore, String keystore_password, String truststore, String truststore_password, List<String> cipher_suites, String protocol, List<String> accepted_protocols, String algorithm, String store_type, boolean require_client_auth, boolean require_endpoint_verification, Boolean enabled, Boolean optional) -
EncryptionOptions
-
-
Method Details
-
applyConfig
-
fillSslContextParams
-
putSslContextFactoryParameter
protected static void putSslContextFactoryParameter(Map<String, Object> existingParameters, EncryptionOptions.ConfigKey configKey, Object value) -
getEnabled
Indicates if the channel should be encrypted. Client and Server uses different logic to determine this- Returns:
- if the channel should be encrypted
-
setEnabled
Sets if encryption should be enabled for this channel. Note that this should only be called by the configuration parser or tests. It is public only for that purpose, mutating enabled state is probably a bad idea.- Parameters:
enabled- value to set
-
getOptional
Indicates if the channel may be encrypted (but is not required to be). Explicitly providing a value in the configuration take precedent. If no optional value is set and !isEnabled(), then optional connections are allowed if a keystore exists. Without it, it would be impossible to establish the connections. Return type is Boolean even though it can never be null so that snakeyaml can find it- Returns:
- if the channel may be encrypted
-
setOptional
Sets if encryption should be optional for this channel. Note that this should only be called by the configuration parser or tests. It is public only for that purpose, mutating enabled state is probably a bad idea.- Parameters:
optional- value to set
-
setProtocol
Sets accepted TLS protocol for this channel. Note that this should only be called by the configuration parser or tests. It is public only for that purpose, mutating protocol state is probably a bad idea.- Parameters:
protocol- value to set
-
getProtocol
-
setAcceptedProtocols
Sets accepted TLS protocols for this channel. Note that this should only be called by the configuration parser or tests. It is public only for that purpose, mutating protocol state is probably a bad idea. The function casing is required for snakeyaml to find this setter for the protected field.- Parameters:
accepted_protocols- value to set
-
getAcceptedProtocols
-
acceptedProtocolsArray
-
cipherSuitesArray
-
tlsEncryptionPolicy
-
withSslContextFactory
-
withKeyStore
-
withKeyStorePassword
-
withTrustStore
-
withTrustStorePassword
-
withCipherSuites
-
withCipherSuites
-
withProtocol
-
withAcceptedProtocols
-
withAlgorithm
-
withStoreType
-
withRequireClientAuth
-
withRequireEndpointVerification
-
withEnabled
-
withOptional
-
equals
The method is being mainly used to cache SslContexts therefore, we only consider fields that would make a difference when the TrustStore or KeyStore files are updated -
hashCode
public int hashCode()The method is being mainly used to cache SslContexts therefore, we only consider fields that would make a difference when the TrustStore or KeyStore files are updated
-