Package org.kiwiproject.config
Class SSLContextConfiguration
java.lang.Object
org.kiwiproject.config.SSLContextConfiguration
- All Implemented Interfaces:
KeyAndTrustStoreConfigProvider,TrustStoreConfigProvider
- Direct Known Subclasses:
SecureEndpointsConfiguration
Configuration for standard/common properties required for secure (i.e. SSL/TLS) connections.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Return a new builder instance.The key store password (plain text).The path to the key store.Key store type.The protocol to use.The trust store password (plain text).The path to the trust store.Trust store type.booleanbooleanDefaults totrue.voidsetDisableSniHostCheck(boolean disableSniHostCheck) voidsetKeyStorePassword(String keyStorePassword) voidsetKeyStorePath(String keyStorePath) voidsetKeyStoreType(String keyStoreType) voidsetProtocol(String protocol) voidsetTrustStorePassword(String trustStorePassword) voidsetTrustStorePath(String trustStorePath) voidsetTrustStoreType(String trustStoreType) voidsetVerifyHostname(boolean verifyHostname) Convert this configuration to aSimpleSSLContextFactory.Convert this instance to a newSSLContext.Convert thisSSLContextConfigurationto aTlsContextConfiguration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kiwiproject.security.TrustStoreConfigProvider
toSslSocketFactory
-
Constructor Details
-
SSLContextConfiguration
public SSLContextConfiguration()
-
-
Method Details
-
builder
Return a new builder instance.- Returns:
- builder instance
-
toSSLContext
Convert this instance to a newSSLContext.If you would rather not create a new instance every time, use
toSimpleSSLContextFactory()to obtain a factory that will always return the sameSSLContextinstance.- Specified by:
toSSLContextin interfaceKeyAndTrustStoreConfigProvider- Specified by:
toSSLContextin interfaceTrustStoreConfigProvider- Returns:
- a new
SSLContextinstance - See Also:
- Implementation Note:
- This will always create a new instance, first creating a new
SimpleSSLContextFactoryand then using that to create theSSLContext.
-
toSimpleSSLContextFactory
Convert this configuration to aSimpleSSLContextFactory.- Returns:
- a new instance
-
toTlsContextConfiguration
Convert thisSSLContextConfigurationto aTlsContextConfiguration.- Returns:
- a new
TlsContextConfigurationinstance
-
getKeyStorePath
Description copied from interface:KeyAndTrustStoreConfigProviderThe path to the key store.- Specified by:
getKeyStorePathin interfaceKeyAndTrustStoreConfigProvider- Returns:
- key store path
-
getKeyStorePassword
Description copied from interface:KeyAndTrustStoreConfigProviderThe key store password (plain text).- Specified by:
getKeyStorePasswordin interfaceKeyAndTrustStoreConfigProvider- Returns:
- key store password
-
getTrustStorePath
Description copied from interface:TrustStoreConfigProviderThe path to the trust store.- Specified by:
getTrustStorePathin interfaceTrustStoreConfigProvider- Returns:
- path to trust store
-
getTrustStorePassword
Description copied from interface:TrustStoreConfigProviderThe trust store password (plain text).- Specified by:
getTrustStorePasswordin interfaceTrustStoreConfigProvider- Returns:
- trust store password
-
getProtocol
Description copied from interface:TrustStoreConfigProviderThe protocol to use. Consider usingSSLContextProtocolto ensure valid protocols.- Specified by:
getProtocolin interfaceTrustStoreConfigProvider- Returns:
- protocol
- See Also:
-
getKeyStoreType
Description copied from interface:KeyAndTrustStoreConfigProviderKey store type. Default is JKS.- Specified by:
getKeyStoreTypein interfaceKeyAndTrustStoreConfigProvider- Returns:
- key store type
- See Also:
-
getTrustStoreType
Description copied from interface:TrustStoreConfigProviderTrust store type. Default is JKS.- Specified by:
getTrustStoreTypein interfaceTrustStoreConfigProvider- Returns:
- trust store type
- See Also:
-
isVerifyHostname
public boolean isVerifyHostname()Description copied from interface:TrustStoreConfigProviderDefaults totrue.- Specified by:
isVerifyHostnamein interfaceTrustStoreConfigProvider- Returns:
- true if hostname verification should be performed
-
isDisableSniHostCheck
public boolean isDisableSniHostCheck() -
setKeyStorePath
-
setKeyStorePassword
-
setTrustStorePath
-
setTrustStorePassword
-
setProtocol
-
setKeyStoreType
-
setTrustStoreType
-
setVerifyHostname
public void setVerifyHostname(boolean verifyHostname) -
setDisableSniHostCheck
public void setDisableSniHostCheck(boolean disableSniHostCheck)
-