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
,HasCamelContext
Represents
SSLContext
configuration options used in instantiating an SSLContext
instance.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.camel.support.jsse.BaseSSLContextParameters
BaseSSLContextParameters.Configurer<T>, BaseSSLContextParameters.SSLContextDecorator, BaseSSLContextParameters.SSLContextSpiDecorator, BaseSSLContextParameters.SSLServerSocketFactoryDecorator, BaseSSLContextParameters.SSLSocketFactoryDecorator
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureSSLContext
(SSLContext context) Configures the actualSSLContext
itself with direct setter calls.createSSLContext
(CamelContext camelContext) Creates anSSLContext
based on the related configuration options of this instance.protected List
<BaseSSLContextParameters.Configurer<SSLEngine>> getSSLEngineConfigurers
(SSLContext context) Returns the list of configurers to apply to anSSLEngine
in order to fully configure it in compliance with the provided configuration options.Returns the list of configurers to apply to anSSLServerSocketFactory
in order to fully configure it in compliance with the provided configuration options.protected List
<BaseSSLContextParameters.Configurer<SSLSocketFactory>> getSSLSocketFactoryConfigurers
(SSLContext context) Returns the list of configurers to apply to anSSLSocketFactory
in order to fully configure it in compliance with the provided configuration options.void
setCertAlias
(String certAlias) An optional certificate alias to use.void
setClientParameters
(SSLContextClientParameters clientParameters) The optional configuration options to be applied purely to the client side settings of theSSLContext
.void
setKeyManagers
(KeyManagersParameters keyManagers) Sets the optional key manager configuration for creating theKeyManager
s used in constructing anSSLContext
.void
setProvider
(String provider) Sets the optional provider identifier to use when constructing anSSLContext
.void
setSecureRandom
(SecureRandomParameters secureRandom) Sets the optional secure random configuration options to use for constructing theSecureRandom
used in the creation of anSSLContext
.void
setSecureSocketProtocol
(String secureSocketProtocol) Sets the optional protocol for the secure sockets created by theSSLContext
represented by this instance's configuration.void
setServerParameters
(SSLContextServerParameters serverParameters) The optional configuration options to be applied purely to the server side settings of theSSLContext
.void
setTrustManagers
(TrustManagersParameters trustManagers) Sets the optional trust manager configuration for creating theTrustManager
s used in constructing anSSLContext
.toString()
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 Details
-
DEFAULT_SECURE_SOCKET_PROTOCOL
- See Also:
-
-
Constructor Details
-
SSLContextParameters
public SSLContextParameters()
-
-
Method Details
-
getKeyManagers
-
setKeyManagers
Sets the optional key manager configuration for creating theKeyManager
s used in constructing anSSLContext
.- Parameters:
keyManagers
- the options ornull
to provide noKeyManager
s
-
getTrustManagers
-
setTrustManagers
Sets the optional trust manager configuration for creating theTrustManager
s used in constructing anSSLContext
.- Parameters:
trustManagers
- the options ornull
to provide noTrustManager
s
-
getSecureRandom
-
setSecureRandom
Sets the optional secure random configuration options to use for constructing theSecureRandom
used in the creation of anSSLContext
.- Parameters:
secureRandom
- the options ornull
to use the default
-
getClientParameters
-
setClientParameters
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 toSSLSocketFactory
s andSSLEngine
s produced by theSSLContext
produced from this class as well as to theSSLContext
itself.- Parameters:
clientParameters
- the optional additional client-side parameters
-
getServerParameters
-
setServerParameters
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 toSSLServerSocketFactory
s andSSLEngine
s produced by theSSLContext
produced from this class as well as to theSSLContext
itself.- Parameters:
serverParameters
- the optional additional client-side parameters
-
getProvider
-
setProvider
Sets the optional provider identifier to use when constructing anSSLContext
.- Parameters:
provider
- the identifier (from the list of available providers returned bySecurity.getProviders()
) ornull
to use the highest priority provider implementing the secure socket protocol- See Also:
-
getSecureSocketProtocol
-
setSecureSocketProtocol
Sets the optional protocol for the secure sockets created by theSSLContext
represented 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 ornull
to use the default (TLS)
-
getCertAlias
-
setCertAlias
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 anSSLContext
based 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
Description copied from class:BaseSSLContextParameters
Configures the actualSSLContext
itself 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:
configureSSLContext
in classBaseSSLContextParameters
- Parameters:
context
- the context to configure- Throws:
GeneralSecurityException
- if there is an error configuring the context
-
getSSLEngineConfigurers
protected List<BaseSSLContextParameters.Configurer<SSLEngine>> getSSLEngineConfigurers(SSLContext context) Description copied from class:BaseSSLContextParameters
Returns the list of configurers to apply to anSSLEngine
in 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:
getSSLEngineConfigurers
in classBaseSSLContextParameters
- Parameters:
context
- the context that serves as the factory forSSLEngine
instances- Returns:
- the needed configurers
-
getSSLSocketFactoryConfigurers
protected List<BaseSSLContextParameters.Configurer<SSLSocketFactory>> getSSLSocketFactoryConfigurers(SSLContext context) Description copied from class:BaseSSLContextParameters
Returns the list of configurers to apply to anSSLSocketFactory
in 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 asSSLSocketFactory
does not contain any configuration options that are non-proprietary.- Overrides:
getSSLSocketFactoryConfigurers
in classBaseSSLContextParameters
- Parameters:
context
- the context that serves as the factory forSSLSocketFactory
instances- Returns:
- the needed configurers
- See Also:
-
getSSLServerSocketFactoryConfigurers
protected List<BaseSSLContextParameters.Configurer<SSLServerSocketFactory>> getSSLServerSocketFactoryConfigurers(SSLContext context) Description copied from class:BaseSSLContextParameters
Returns the list of configurers to apply to anSSLServerSocketFactory
in 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 asSSLServerSocketFactory
does not contain any configuration options that are non-proprietary.- Overrides:
getSSLServerSocketFactoryConfigurers
in classBaseSSLContextParameters
- Parameters:
context
- the context that serves as the factory forSSLServerSocketFactory
instances- Returns:
- the needed configurers
- See Also:
-
toString
-