Package org.elasticsearch.common.ssl
Class SslConfiguration
java.lang.Object
org.elasticsearch.common.ssl.SslConfiguration
public class SslConfiguration
extends java.lang.Object
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
Constructors Constructor Description SslConfiguration(SslTrustConfig trustConfig, SslKeyConfig keyConfig, SslVerificationMode verificationMode, SslClientAuthenticationMode clientAuth, java.util.List<java.lang.String> ciphers, java.util.List<java.lang.String> supportedProtocols) -
Method Summary
Modifier and Type Method Description javax.net.ssl.SSLContextcreateSslContext()Dynamically create a new SSL context based on the current state of the configuration.booleanequals(java.lang.Object o)java.util.List<java.lang.String>getCipherSuites()SslClientAuthenticationModegetClientAuth()java.util.Collection<java.nio.file.Path>getDependentFiles()SslKeyConfiggetKeyConfig()java.util.List<java.lang.String>getSupportedProtocols()SslTrustConfiggetTrustConfig()SslVerificationModegetVerificationMode()inthashCode()java.lang.StringtoString()
-
Constructor Details
-
SslConfiguration
public SslConfiguration(SslTrustConfig trustConfig, SslKeyConfig keyConfig, SslVerificationMode verificationMode, SslClientAuthenticationMode clientAuth, java.util.List<java.lang.String> ciphers, java.util.List<java.lang.String> supportedProtocols)
-
-
Method Details
-
getTrustConfig
-
getKeyConfig
-
getVerificationMode
-
getClientAuth
-
getCipherSuites
public java.util.List<java.lang.String> getCipherSuites() -
getSupportedProtocols
public java.util.List<java.lang.String> getSupportedProtocols() -
getDependentFiles
public java.util.Collection<java.nio.file.Path> 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.
-
createSslContext
public javax.net.ssl.SSLContext 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. -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-