public abstract class SSLContextContainerAbstract extends Object implements SSLContextContainerIfc
Modifier and Type | Class and Description |
---|---|
protected class |
SSLContextContainerAbstract.SSLHolder |
ALLOW_INVALID_CERTS_KEY, ALLOW_INVALID_CERTS_VAL, ALLOW_SELF_SIGNED_CERTS_KEY, ALLOW_SELF_SIGNED_CERTS_VAL, CERT_ALIAS_KEY, CERT_SAVE_TO_DISK_KEY, DEFAULT_DOMAIN_CERT_KEY, DEFAULT_DOMAIN_CERT_VAL, JKS_KEYSTORE_FILE_KEY, JKS_KEYSTORE_FILE_VAL, JKS_KEYSTORE_PWD_KEY, JKS_KEYSTORE_PWD_VAL, PEM_CERTIFICATE_KEY, SERVER_CERTS_LOCATION_KEY, SERVER_CERTS_LOCATION_VAL, SSL_CONTAINER_CLASS_KEY, SSL_CONTAINER_CLASS_VAL, TRUSTED_CERTS_DIR_KEY, TRUSTED_CERTS_DIR_VAL, TRUSTSTORE_FILE_KEY, TRUSTSTORE_FILE_VAL, TRUSTSTORE_PWD_KEY, TRUSTSTORE_PWD_VAL
Constructor and Description |
---|
SSLContextContainerAbstract(CertificateContainerIfc certContainer) |
Modifier and Type | Method and Description |
---|---|
void |
addCertificates(Map<String,String> params)
Method
addCertificates allows to add more certificates at run time after the container has bee
already initialized. |
protected KeyManager[] |
createCertificate(String alias) |
protected SSLContextContainerAbstract.SSLHolder |
createContextHolder(String protocol,
String hostname,
String alias,
boolean clientMode,
TrustManager[] tms)
Common method used to create SSLContext instance based on provided parameters
|
static <T> T |
find(Map<String,T> lookupMap,
String domain)
Generic method responsible for lookup of value in
Map where passed key is domain name and in
Map wildcard name may be used as a key. |
protected String |
getDefCertAlias() |
protected KeyManager[] |
getKeyManagers(String hostname) |
SSLContext |
getSSLContext(String protocol,
String hostname,
boolean clientMode)
Method
getSSLContext creates and returns new SSLContext for a given domain (hostname). |
protected TrustManager[] |
getTrustManagers() |
KeyStore |
getTrustStore()
Returns a trust store with all trusted certificates.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createIoInterface, createIoInterface, getEnabledCiphers, getEnabledCiphers, getEnabledProtocols, getEnabledProtocols, getSSLContext
public SSLContextContainerAbstract(CertificateContainerIfc certContainer)
public static <T> T find(Map<String,T> lookupMap, String domain)
Map
where passed key is domain name and in
Map
wildcard name may be used as a key.public void addCertificates(Map<String,String> params) throws CertificateParsingException
SSLContextContainerIfc
addCertificates
allows to add more certificates at run time after the container has bee
already initialized. This is to avoid server restart if there are certificates updates or new certificates for
new virtual domain. The method should add new certificates or replace existing one if there is already a
certificate for a domain.addCertificates
in interface SSLContextContainerIfc
params
- a Map
value with configuration parameters.CertificateParsingException
public SSLContext getSSLContext(String protocol, String hostname, boolean clientMode)
SSLContextContainerIfc
getSSLContext
creates and returns new SSLContext for a given domain (hostname). For creation
of the SSLContext a certificate associated with this domain (hostname) should be used. If there is no specific
certificate for a given domain then default certificate should be used.getSSLContext
in interface SSLContextContainerIfc
protocol
- a String
is either 'SSL' or 'TLS' value.hostname
- a String
value keeps a hostname or domain for SSLContext.clientMode
- if set SSLContext will be created for client mode (ie. creation of server certificate will be
skipped if there is no certificate)SSLContext
valuepublic KeyStore getTrustStore()
SSLContextContainerIfc
getTrustStore
in interface SSLContextContainerIfc
protected KeyManager[] createCertificate(String alias) throws Exception
Exception
protected SSLContextContainerAbstract.SSLHolder createContextHolder(String protocol, String hostname, String alias, boolean clientMode, TrustManager[] tms) throws Exception
Exception
protected String getDefCertAlias()
protected KeyManager[] getKeyManagers(String hostname)
protected TrustManager[] getTrustManagers()
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.