public abstract class FileBasedSslContextFactory extends AbstractSslContextFactory
ISslContextFactory
using file based, standard keystore format with the ability
to hot-reload the files upon file changes (detected by the last modified timestamp
).
CAUTION:
While this is a useful abstraction, please be careful if you need to modify this class
given possible custom implementations out there!
Modifier and Type | Class and Description |
---|---|
protected static class |
FileBasedSslContextFactory.HotReloadableFile
Helper class for hot reloading SSL Contexts
|
ISslContextFactory.SocketType
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkedExpiry |
protected java.util.List<FileBasedSslContextFactory.HotReloadableFile> |
hotReloadableFiles
List of files that trigger hot reloading of SSL certificates
|
protected java.lang.String |
keystore |
protected java.lang.String |
keystore_password |
protected java.lang.String |
truststore |
protected java.lang.String |
truststore_password |
accepted_protocols, algorithm, cipher_suites, enabled, openSslIsAvailable, optional, parameters, protocol, require_client_auth, require_endpoint_verification, store_type, TLS_PROTOCOL_SUBSTITUTION
Constructor and Description |
---|
FileBasedSslContextFactory() |
FileBasedSslContextFactory(java.util.Map<java.lang.String,java.lang.Object> parameters) |
Modifier and Type | Method and Description |
---|---|
protected javax.net.ssl.KeyManagerFactory |
buildKeyManagerFactory()
Builds required KeyManagerFactory from the file based keystore.
|
protected javax.net.ssl.TrustManagerFactory |
buildTrustManagerFactory()
Builds TrustManagerFactory from the file based truststore.
|
protected boolean |
checkExpiredCerts(java.security.KeyStore ks) |
boolean |
hasKeystore()
Returns if this factory uses private keystore.
|
void |
initHotReloading()
Initializes hot reloading of the security keys/certs.
|
boolean |
shouldReload()
Returns if any changes require the reloading of the SSL context returned by this factory.
|
createJSSESslContext, createNettySslContext, deriveIfOpenSslAvailable, getAcceptedProtocols, getBoolean, getBoolean, getCipherSuites, getSslProvider, getString, getString, getStringList
protected volatile boolean checkedExpiry
protected volatile java.util.List<FileBasedSslContextFactory.HotReloadableFile> hotReloadableFiles
protected java.lang.String keystore
protected java.lang.String keystore_password
protected java.lang.String truststore
protected java.lang.String truststore_password
public FileBasedSslContextFactory()
public FileBasedSslContextFactory(java.util.Map<java.lang.String,java.lang.Object> parameters)
public boolean shouldReload()
ISslContextFactory
true
if SSL Context needs to be reload; false
otherwisepublic boolean hasKeystore()
ISslContextFactory
true
by default unless the implementation overrides thispublic void initHotReloading()
ISslContextFactory
protected javax.net.ssl.KeyManagerFactory buildKeyManagerFactory() throws javax.net.ssl.SSLException
warning
for each expired PrivateKey's certitificate.buildKeyManagerFactory
in class AbstractSslContextFactory
javax.net.ssl.SSLException
- if any issues encountered during the build processprotected javax.net.ssl.TrustManagerFactory buildTrustManagerFactory() throws javax.net.ssl.SSLException
buildTrustManagerFactory
in class AbstractSslContextFactory
javax.net.ssl.SSLException
- if any issues encountered during the build processprotected boolean checkExpiredCerts(java.security.KeyStore ks) throws java.security.KeyStoreException
java.security.KeyStoreException
Copyright © 2009-2022 The Apache Software Foundation