Package org.apache.camel.support.jsse
Class SSLContextParameters
- java.lang.Object
-
- org.apache.camel.support.jsse.JsseParameters
-
- org.apache.camel.support.jsse.BaseSSLContextParameters
-
- org.apache.camel.support.jsse.SSLContextParameters
-
- All Implemented Interfaces:
CamelContextAware
public class SSLContextParameters extends BaseSSLContextParameters
RepresentsSSLContextconfiguration options used in instantiating anSSLContextinstance.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.camel.support.jsse.BaseSSLContextParameters
BaseSSLContextParameters.SSLContextDecorator, BaseSSLContextParameters.SSLContextSpiDecorator, BaseSSLContextParameters.SSLServerSocketFactoryDecorator, BaseSSLContextParameters.SSLSocketFactoryDecorator
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringDEFAULT_SECURE_SOCKET_PROTOCOL-
Fields inherited from class org.apache.camel.support.jsse.BaseSSLContextParameters
DEFAULT_CIPHER_SUITES_FILTER_EXCLUDE, DEFAULT_CIPHER_SUITES_FILTER_INCLUDE, DEFAULT_SECURE_SOCKET_PROTOCOLS_FILTER_EXCLUDE, DEFAULT_SECURE_SOCKET_PROTOCOLS_FILTER_INCLUDE
-
-
Constructor Summary
Constructors Constructor Description SSLContextParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureSSLContext(SSLContext context)Configures the actualSSLContextitself with direct setter calls.SSLContextcreateSSLContext(CamelContext camelContext)Creates anSSLContextbased on the related configuration options of this instance.StringgetCertAlias()SSLContextClientParametersgetClientParameters()KeyManagersParametersgetKeyManagers()StringgetProvider()SecureRandomParametersgetSecureRandom()StringgetSecureSocketProtocol()SSLContextServerParametersgetServerParameters()protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLEngine>>getSSLEngineConfigurers(SSLContext context)Returns the list of configurers to apply to anSSLEnginein order to fully configure it in compliance with the provided configuration options.protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLServerSocketFactory>>getSSLServerSocketFactoryConfigurers(SSLContext context)Returns the list of configurers to apply to anSSLServerSocketFactoryin order to fully configure it in compliance with the provided configuration options.protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLSocketFactory>>getSSLSocketFactoryConfigurers(SSLContext context)Returns the list of configurers to apply to anSSLSocketFactoryin order to fully configure it in compliance with the provided configuration options.TrustManagersParametersgetTrustManagers()voidsetCertAlias(String certAlias)An optional certificate alias to use.voidsetClientParameters(SSLContextClientParameters clientParameters)The optional configuration options to be applied purely to the client side settings of theSSLContext.voidsetKeyManagers(KeyManagersParameters keyManagers)Sets the optional key manager configuration for creating theKeyManagers used in constructing anSSLContext.voidsetProvider(String provider)Sets the optional provider identifier to use when constructing anSSLContext.voidsetSecureRandom(SecureRandomParameters secureRandom)Sets the optional secure random configuration options to use for constructing theSecureRandomused in the creation of anSSLContext.voidsetSecureSocketProtocol(String secureSocketProtocol)Sets the optional protocol for the secure sockets created by theSSLContextrepresented by this instance's configuration.voidsetServerParameters(SSLContextServerParameters serverParameters)The optional configuration options to be applied purely to the server side settings of theSSLContext.voidsetTrustManagers(TrustManagersParameters trustManagers)Sets the optional trust manager configuration for creating theTrustManagers used in constructing anSSLContext.StringtoString()-
Methods inherited from class org.apache.camel.support.jsse.BaseSSLContextParameters
configureSessionContext, filter, filter, getAllowPassthrough, getCipherSuites, getCipherSuitesFilter, getDefaultCipherSuitesFilter, getDefaultSecureSocketProcotolFilter, getSecureSocketProtocols, getSecureSocketProtocolsFilter, getSessionTimeout, getSNIHostNames, getSSLServerSocketFactorySSLServerSocketConfigurers, getSSLSocketFactorySSLSocketConfigurers, matchesOneOf, setCipherSuites, setCipherSuitesFilter, setSecureSocketProtocols, setSecureSocketProtocolsFilter, setSessionTimeout
-
Methods inherited from class org.apache.camel.support.jsse.JsseParameters
getCamelContext, parsePropertyValue, parsePropertyValues, resolveResource, setCamelContext
-
-
-
-
Field Detail
-
DEFAULT_SECURE_SOCKET_PROTOCOL
protected static final String DEFAULT_SECURE_SOCKET_PROTOCOL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKeyManagers
public KeyManagersParameters getKeyManagers()
-
setKeyManagers
public void setKeyManagers(KeyManagersParameters keyManagers)
Sets the optional key manager configuration for creating theKeyManagers used in constructing anSSLContext.- Parameters:
keyManagers- the options ornullto provide noKeyManagers
-
getTrustManagers
public TrustManagersParameters getTrustManagers()
-
setTrustManagers
public void setTrustManagers(TrustManagersParameters trustManagers)
Sets the optional trust manager configuration for creating theTrustManagers used in constructing anSSLContext.- Parameters:
trustManagers- the options ornullto provide noTrustManagers
-
getSecureRandom
public SecureRandomParameters getSecureRandom()
-
setSecureRandom
public void setSecureRandom(SecureRandomParameters secureRandom)
Sets the optional secure random configuration options to use for constructing theSecureRandomused in the creation of anSSLContext.- Parameters:
secureRandom- the options ornullto use the default
-
getClientParameters
public SSLContextClientParameters getClientParameters()
-
setClientParameters
public void setClientParameters(SSLContextClientParameters clientParameters)
The optional configuration options to be applied purely to the client side settings of theSSLContext. Settings specified here override any duplicate settings provided at the overall level by this class. These parameters apply toSSLSocketFactorys andSSLEngines produced by theSSLContextproduced from this class as well as to theSSLContextitself.- Parameters:
clientParameters- the optional additional client-side parameters
-
getServerParameters
public SSLContextServerParameters getServerParameters()
-
setServerParameters
public void setServerParameters(SSLContextServerParameters serverParameters)
The optional configuration options to be applied purely to the server side settings of theSSLContext. Settings specified here override any duplicate settings provided at the overall level by this class. These parameters apply toSSLServerSocketFactorys andSSLEngines produced by theSSLContextproduced from this class as well as to theSSLContextitself.- Parameters:
serverParameters- the optional additional client-side parameters
-
getProvider
public String getProvider()
-
setProvider
public void setProvider(String provider)
Sets the optional provider identifier to use when constructing anSSLContext.- Parameters:
provider- the identifier (from the list of available providers returned bySecurity.getProviders()) ornullto use the highest priority provider implementing the secure socket protocol- See Also:
Security.getProviders(java.util.Map),setSecureSocketProtocol(String)
-
getSecureSocketProtocol
public String getSecureSocketProtocol()
-
setSecureSocketProtocol
public void setSecureSocketProtocol(String secureSocketProtocol)
Sets the optional protocol for the secure sockets created by theSSLContextrepresented by this instance's configuration. Defaults to TLS. See Appendix A in the Java Secure Socket Extension Reference Guide for information about standard protocol names.- Parameters:
secureSocketProtocol- the name of the protocol ornullto use the default (TLS)
-
getCertAlias
public String getCertAlias()
-
setCertAlias
public void setCertAlias(String certAlias)
An optional certificate alias to use. This is useful when the keystore has multiple certificates.- Parameters:
certAlias- an optional certificate alias to use
-
createSSLContext
public SSLContext createSSLContext(CamelContext camelContext) throws GeneralSecurityException, IOException
Creates anSSLContextbased on the related configuration options of this instance. Namely,keyManagers,trustManagers, andsecureRandom, but also respecting the chosen provider and secure socket protocol as well.- Parameters:
camelContext- The camel context- Returns:
- a newly configured instance
- Throws:
GeneralSecurityException- if there is a problem in this instances configuration or that of its nested configuration optionsIOException- if there is an error reading a key/trust store
-
configureSSLContext
protected void configureSSLContext(SSLContext context) throws GeneralSecurityException
Description copied from class:BaseSSLContextParametersConfigures the actualSSLContextitself with direct setter calls. This method differs from configuration options that are handled by a configurer instance in that the options are part of the context itself and are not part of some factory or instance object returned by the context.- Overrides:
configureSSLContextin classBaseSSLContextParameters- Parameters:
context- the context to configure- Throws:
GeneralSecurityException- if there is an error configuring the context
-
getSSLEngineConfigurers
protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLEngine>> getSSLEngineConfigurers(SSLContext context)
Description copied from class:BaseSSLContextParametersReturns the list of configurers to apply to anSSLEnginein order to fully configure it in compliance with the provided configuration options. The configurers are to be applied in the order in which they appear in the list.- Overrides:
getSSLEngineConfigurersin classBaseSSLContextParameters- Parameters:
context- the context that serves as the factory forSSLEngineinstances- Returns:
- the needed configurers
-
getSSLSocketFactoryConfigurers
protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLSocketFactory>> getSSLSocketFactoryConfigurers(SSLContext context)
Description copied from class:BaseSSLContextParametersReturns the list of configurers to apply to anSSLSocketFactoryin order to fully configure it in compliance with the provided configuration options. The configurers are to be applied in the order in which they appear in the list. It is preferred to useBaseSSLContextParameters.getSSLSocketFactorySSLSocketConfigurers(SSLContext)instead of this method asSSLSocketFactorydoes not contain any configuration options that are non-proprietary.- Overrides:
getSSLSocketFactoryConfigurersin classBaseSSLContextParameters- Parameters:
context- the context that serves as the factory forSSLSocketFactoryinstances- Returns:
- the needed configurers
- See Also:
BaseSSLContextParameters.getSSLSocketFactorySSLSocketConfigurers(SSLContext)
-
getSSLServerSocketFactoryConfigurers
protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLServerSocketFactory>> getSSLServerSocketFactoryConfigurers(SSLContext context)
Description copied from class:BaseSSLContextParametersReturns the list of configurers to apply to anSSLServerSocketFactoryin order to fully configure it in compliance with the provided configuration options. The configurers are to be applied in the order in which they appear in the list. It is preferred to useBaseSSLContextParameters.getSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext)instead of this method asSSLServerSocketFactorydoes not contain any configuration options that are non-proprietary.- Overrides:
getSSLServerSocketFactoryConfigurersin classBaseSSLContextParameters- Parameters:
context- the context that serves as the factory forSSLServerSocketFactoryinstances- Returns:
- the needed configurers
- See Also:
BaseSSLContextParameters.getSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext)
-
-