java.lang.Object
org.elasticsearch.common.ssl.PemTrustConfig
- All Implemented Interfaces:
SslTrustConfig
A
SslTrustConfig that reads a list of PEM encoded trusted certificates (CAs) from the file
system.
Strictly speaking, this class does not require PEM certificates, and will load any file that can be read by
CertificateFactory.generateCertificate(InputStream).-
Constructor Summary
ConstructorsConstructorDescriptionPemTrustConfig(List<String> certificateAuthorities, Path basePath) Construct a new trust config for the provided paths (which will be resolved relative to the basePath). -
Method Summary
Modifier and TypeMethodDescriptionbooleanCollection<? extends StoredCertificate> inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.ssl.SslTrustConfig
isSystemDefault
-
Constructor Details
-
PemTrustConfig
Construct a new trust config for the provided paths (which will be resolved relative to the basePath). The paths are stored as-is, and are not read untilcreateTrustManager()is called. This means that- validation of the file (contents and accessibility) is deferred, and this constructor will not fail on missing of invalid files.
-
if the contents of the files are modified, then subsequent calls
createTrustManager()will return a new trust manager that trust a different set of CAs.
-
-
Method Details
-
getDependentFiles
- Specified by:
getDependentFilesin interfaceSslTrustConfig- Returns:
- A collection of files that are read by this config object.
The
SslTrustConfig.createTrustManager()method will read these files dynamically, so the behaviour of this trust config may change if any of these files are modified.
-
getConfiguredCertificates
- Specified by:
getConfiguredCertificatesin interfaceSslTrustConfig- Returns:
- A collection of
certificatesused by this config, excluding those shipped with the JDK
-
createTrustManager
- Specified by:
createTrustManagerin interfaceSslTrustConfig- Returns:
- A new
X509ExtendedTrustManager.
-
toString
-
equals
-
hashCode
public int hashCode()
-