public abstract class AbstractSslContextFactory extends java.lang.Object implements ISslContextFactory
ISslContextFacotry
to provide most of the functionality that any
implementation might need. This does not assume any file-based credentials for keys/certs hence provide a good base
for any implementation that only need to customize the loading of keys/certs in a custom way.
CAUTION:
While this is extremely useful abstraction, please be careful if you need to modify this class
given possible custom implementations out there!
DefaultSslContextFactory
ISslContextFactory.SocketType
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
accepted_protocols |
protected java.lang.String |
algorithm |
protected java.util.List<java.lang.String> |
cipher_suites |
protected java.lang.Boolean |
enabled |
protected boolean |
openSslIsAvailable |
protected java.lang.Boolean |
optional |
protected java.util.Map<java.lang.String,java.lang.Object> |
parameters |
protected java.lang.String |
protocol |
protected boolean |
require_client_auth |
protected boolean |
require_endpoint_verification |
protected java.lang.String |
store_type |
protected static java.util.List<java.lang.String> |
TLS_PROTOCOL_SUBSTITUTION |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSslContextFactory() |
protected |
AbstractSslContextFactory(java.util.Map<java.lang.String,java.lang.Object> parameters) |
Modifier and Type | Method and Description |
---|---|
protected abstract javax.net.ssl.KeyManagerFactory |
buildKeyManagerFactory() |
protected abstract javax.net.ssl.TrustManagerFactory |
buildTrustManagerFactory() |
javax.net.ssl.SSLContext |
createJSSESslContext(boolean verifyPeerCertificate)
Creates JSSE SSLContext.
|
io.netty.handler.ssl.SslContext |
createNettySslContext(boolean verifyPeerCertificate,
ISslContextFactory.SocketType socketType,
io.netty.handler.ssl.CipherSuiteFilter cipherFilter)
Creates Netty's SslContext object.
|
protected void |
deriveIfOpenSslAvailable()
Dervies if
OpenSSL is available. |
java.util.List<java.lang.String> |
getAcceptedProtocols()
Combine the pre-4.0 protocol field with the accepted_protocols list, substituting a list of
explicit protocols for the previous catchall default of "TLS"
|
protected java.lang.Boolean |
getBoolean(java.lang.String key) |
protected java.lang.Boolean |
getBoolean(java.lang.String key,
boolean defaultValue) |
java.util.List<java.lang.String> |
getCipherSuites()
Returns the list of cipher suites supported by the implementation.
|
protected io.netty.handler.ssl.SslProvider |
getSslProvider()
Returns
SslProvider to be used to build Netty's SslContext. |
protected java.lang.String |
getString(java.lang.String key) |
protected java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue) |
protected java.util.List<java.lang.String> |
getStringList(java.lang.String key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasKeystore, initHotReloading, shouldReload
protected static final java.util.List<java.lang.String> TLS_PROTOCOL_SUBSTITUTION
protected boolean openSslIsAvailable
protected final java.util.Map<java.lang.String,java.lang.Object> parameters
protected final java.util.List<java.lang.String> cipher_suites
protected final java.lang.String protocol
protected final java.util.List<java.lang.String> accepted_protocols
protected final java.lang.String algorithm
protected final java.lang.String store_type
protected final boolean require_client_auth
protected final boolean require_endpoint_verification
protected java.lang.Boolean enabled
protected java.lang.Boolean optional
protected AbstractSslContextFactory()
protected AbstractSslContextFactory(java.util.Map<java.lang.String,java.lang.Object> parameters)
protected void deriveIfOpenSslAvailable()
OpenSSL
is available. It allows in-jvm dtests to disable tcnative openssl support by
setting cassandra.disable_tcactive_openssl
system property as true
. Otherwise, it creates a
circular reference that prevents the instance class loader from being garbage collected.protected java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
protected java.lang.String getString(java.lang.String key)
protected java.util.List<java.lang.String> getStringList(java.lang.String key)
protected java.lang.Boolean getBoolean(java.lang.String key, boolean defaultValue)
protected java.lang.Boolean getBoolean(java.lang.String key)
public javax.net.ssl.SSLContext createJSSESslContext(boolean verifyPeerCertificate) throws javax.net.ssl.SSLException
ISslContextFactory
createJSSESslContext
in interface ISslContextFactory
verifyPeerCertificate
- true
if SSL peer's certificate needs to be verified; false
otherwiseSSLContext
javax.net.ssl.SSLException
- in case the Ssl Context creation fails for some reasonpublic io.netty.handler.ssl.SslContext createNettySslContext(boolean verifyPeerCertificate, ISslContextFactory.SocketType socketType, io.netty.handler.ssl.CipherSuiteFilter cipherFilter) throws javax.net.ssl.SSLException
ISslContextFactory
createNettySslContext
in interface ISslContextFactory
verifyPeerCertificate
- true
if SSL peer's certificate needs to be verified; false
otherwisesocketType
- ISslContextFactory.SocketType
for Netty's Inbound or Outbound channelscipherFilter
- to allow Netty's cipher suite filtering, e.g.
SslContextBuilder.ciphers(Iterable, CipherSuiteFilter)
SslContext
javax.net.ssl.SSLException
- in case the Ssl Context creation fails for some reasonpublic java.util.List<java.lang.String> getAcceptedProtocols()
getAcceptedProtocols
in interface ISslContextFactory
public java.util.List<java.lang.String> getCipherSuites()
ISslContextFactory
getCipherSuites
in interface ISslContextFactory
protected io.netty.handler.ssl.SslProvider getSslProvider()
SslProvider
to be used to build Netty's SslContext.protected abstract javax.net.ssl.KeyManagerFactory buildKeyManagerFactory() throws javax.net.ssl.SSLException
javax.net.ssl.SSLException
protected abstract javax.net.ssl.TrustManagerFactory buildTrustManagerFactory() throws javax.net.ssl.SSLException
javax.net.ssl.SSLException
Copyright © 2009-2022 The Apache Software Foundation