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
RepresentsSSLContext
configuration options used in instantiating anSSLContext
instance.
-
-
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 String
DEFAULT_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 void
configureSSLContext(SSLContext context)
Configures the actualSSLContext
itself with direct setter calls.SSLContext
createSSLContext(CamelContext camelContext)
Creates anSSLContext
based on the related configuration options of this instance.String
getCertAlias()
SSLContextClientParameters
getClientParameters()
KeyManagersParameters
getKeyManagers()
String
getProvider()
SecureRandomParameters
getSecureRandom()
String
getSecureSocketProtocol()
SSLContextServerParameters
getServerParameters()
protected List<org.apache.camel.support.jsse.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.protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLServerSocketFactory>>
getSSLServerSocketFactoryConfigurers(SSLContext context)
Returns the list of configurers to apply to anSSLServerSocketFactory
in 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 anSSLSocketFactory
in order to fully configure it in compliance with the provided configuration options.TrustManagersParameters
getTrustManagers()
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
.String
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 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 theKeyManager
s used in constructing anSSLContext
.- Parameters:
keyManagers
- the options ornull
to provide noKeyManager
s
-
getTrustManagers
public TrustManagersParameters getTrustManagers()
-
setTrustManagers
public void setTrustManagers(TrustManagersParameters trustManagers)
Sets the optional trust manager configuration for creating theTrustManager
s used in constructing anSSLContext
.- Parameters:
trustManagers
- the options ornull
to provide noTrustManager
s
-
getSecureRandom
public SecureRandomParameters getSecureRandom()
-
setSecureRandom
public void setSecureRandom(SecureRandomParameters secureRandom)
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
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 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
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 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
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()
) ornull
to 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 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
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 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
protected void configureSSLContext(SSLContext context) throws GeneralSecurityException
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<org.apache.camel.support.jsse.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<org.apache.camel.support.jsse.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:
BaseSSLContextParameters.getSSLSocketFactorySSLSocketConfigurers(SSLContext)
-
getSSLServerSocketFactoryConfigurers
protected List<org.apache.camel.support.jsse.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:
BaseSSLContextParameters.getSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext)
-
-