Module org.elasticsearch.sslconfig
Package org.elasticsearch.common.ssl
Record Class SslConfiguration
java.lang.Object
java.lang.Record
org.elasticsearch.common.ssl.SslConfiguration
public record SslConfiguration(String settingPrefix, boolean explicitlyConfigured, SslTrustConfig trustConfig, SslKeyConfig keyConfig, SslVerificationMode verificationMode, SslClientAuthenticationMode clientAuth, List<String> ciphers, List<String> supportedProtocols)
extends Record
A object encapsulating all necessary configuration for an SSL context (client or server).
The configuration itself is immutable, but the
key config and
trust config may depend on reading key and certificate material
from files (see getDependentFiles(), and the content of those files may change.-
Constructor Summary
ConstructorsConstructorDescriptionSslConfiguration(String settingPrefix, boolean explicitlyConfigured, SslTrustConfig trustConfig, SslKeyConfig keyConfig, SslVerificationMode verificationMode, SslClientAuthenticationMode clientAuth, List<String> ciphers, List<String> supportedProtocols) Creates an instance of aSslConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionciphers()Returns the value of theciphersrecord component.Returns the value of theclientAuthrecord component.Dynamically create a new SSL context based on the current state of the configuration.booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theexplicitlyConfiguredrecord component.Collection<? extends StoredCertificate> inthashCode()Returns a hash code value for this object.Returns the value of thekeyConfigrecord component.Returns the value of thesettingPrefixrecord component.Returns the value of thesupportedProtocolsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetrustConfigrecord component.Returns the value of theverificationModerecord component.
-
Constructor Details
-
SslConfiguration
public SslConfiguration(String settingPrefix, boolean explicitlyConfigured, SslTrustConfig trustConfig, SslKeyConfig keyConfig, SslVerificationMode verificationMode, SslClientAuthenticationMode clientAuth, List<String> ciphers, List<String> supportedProtocols) Creates an instance of aSslConfigurationrecord class.- Parameters:
settingPrefix- the value for thesettingPrefixrecord componentexplicitlyConfigured- the value for theexplicitlyConfiguredrecord componenttrustConfig- the value for thetrustConfigrecord componentkeyConfig- the value for thekeyConfigrecord componentverificationMode- the value for theverificationModerecord componentclientAuth- the value for theclientAuthrecord componentciphers- the value for theciphersrecord componentsupportedProtocols- the value for thesupportedProtocolsrecord component
-
-
Method Details
-
getCipherSuites
-
getDependentFiles
- Returns:
- A collection of files that are used by this SSL configuration. If the contents of these files change, then any
subsequent call to
createSslContext()(or similar methods) may create a context with different behaviour. It is recommended that these files be monitored for changes, and a new ssl-context is created whenever any of the files are modified.
-
getConfiguredCertificates
- Returns:
- A collection of
certificatesthat are used by this SSL configuration. This includes certificates used for identity (with a private key) and those used for trust, but excludes certificates that are provided by the JRE.
-
createSslContext
Dynamically create a new SSL context based on the current state of the configuration. Because thekey configandtrust configmay change based on the contents of their referenced files (seegetDependentFiles(), consecutive calls to this method may return ssl-contexts with different configurations. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
settingPrefix
Returns the value of thesettingPrefixrecord component.- Returns:
- the value of the
settingPrefixrecord component
-
explicitlyConfigured
public boolean explicitlyConfigured()Returns the value of theexplicitlyConfiguredrecord component.- Returns:
- the value of the
explicitlyConfiguredrecord component
-
trustConfig
Returns the value of thetrustConfigrecord component.- Returns:
- the value of the
trustConfigrecord component
-
keyConfig
Returns the value of thekeyConfigrecord component.- Returns:
- the value of the
keyConfigrecord component
-
verificationMode
Returns the value of theverificationModerecord component.- Returns:
- the value of the
verificationModerecord component
-
clientAuth
Returns the value of theclientAuthrecord component.- Returns:
- the value of the
clientAuthrecord component
-
ciphers
Returns the value of theciphersrecord component.- Returns:
- the value of the
ciphersrecord component
-
supportedProtocols
Returns the value of thesupportedProtocolsrecord component.- Returns:
- the value of the
supportedProtocolsrecord component
-