public abstract class AbstractSSLContextInitializer extends Object implements SSLContextInitializer
Modifier and Type | Field and Description |
---|---|
protected HostnameVerifierConfig |
hostnameVerifierConfig
Hostname verifier config.
|
protected Logger |
logger
Logger for this class.
|
protected TrustManager[] |
trustManagers
Trust managers.
|
Constructor and Description |
---|
AbstractSSLContextInitializer() |
Modifier and Type | Method and Description |
---|---|
protected TrustManager[] |
aggregateTrustManagers(TrustManager... managers)
Creates an
AggregateTrustManager containing the supplied trust managers. |
protected abstract TrustManager[] |
createTrustManagers()
Creates any trust managers specific to this context initializer.
|
HostnameVerifierConfig |
getHostnameVerifierConfig()
Returns the hostname verifier config used when created SSL contexts.
|
TrustManager[] |
getTrustManagers()
Returns the trust managers used when creating SSL contexts.
|
SSLContext |
initSSLContext(String protocol)
Creates an initialized SSLContext for the supplied protocol.
|
void |
setHostnameVerifierConfig(HostnameVerifierConfig config)
Sets the hostname verifier config.
|
void |
setTrustManagers(TrustManager... managers)
Sets the trust managers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKeyManagers
protected final Logger logger
protected TrustManager[] trustManagers
protected HostnameVerifierConfig hostnameVerifierConfig
public TrustManager[] getTrustManagers() throws GeneralSecurityException
SSLContextInitializer
getTrustManagers
in interface SSLContextInitializer
GeneralSecurityException
- if an errors occurs while loading the TrustManagerspublic void setTrustManagers(TrustManager... managers)
SSLContextInitializer
setTrustManagers
in interface SSLContextInitializer
managers
- trust managerspublic HostnameVerifierConfig getHostnameVerifierConfig()
SSLContextInitializer
getHostnameVerifierConfig
in interface SSLContextInitializer
public void setHostnameVerifierConfig(HostnameVerifierConfig config)
SSLContextInitializer
setHostnameVerifierConfig
in interface SSLContextInitializer
config
- hostname verifier configprotected abstract TrustManager[] createTrustManagers() throws GeneralSecurityException
GeneralSecurityException
- if an errors occurs while loading the TrustManagerspublic SSLContext initSSLContext(String protocol) throws GeneralSecurityException
SSLContextInitializer
initSSLContext
in interface SSLContextInitializer
protocol
- type to use for SSLGeneralSecurityException
- if the SSLContext cannot be createdprotected TrustManager[] aggregateTrustManagers(TrustManager... managers)
AggregateTrustManager
containing the supplied trust managers.managers
- to aggregateCopyright © 2003-2019 Virginia Tech. All Rights Reserved.