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
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureSSLContext(SSLContext context) Configures the actualSSLContextitself with direct setter calls.createSSLContext(CamelContext camelContext) Creates anSSLContextbased on the related configuration options of this instance.protected List<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.Returns the list of configurers to apply to anSSLServerSocketFactoryin 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 anSSLSocketFactoryin order to fully configure it in compliance with the provided configuration options.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.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, setSessionTimeoutMethods 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 theKeyManagers used in constructing anSSLContext.- Parameters:
keyManagers- the options ornullto provide noKeyManagers
-
getTrustManagers
-
setTrustManagers
Sets the optional trust manager configuration for creating theTrustManagers used in constructing anSSLContext.- Parameters:
trustManagers- the options ornullto provide noTrustManagers
-
getSecureRandom
-
setSecureRandom
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
-
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 toSSLSocketFactorys andSSLEngines produced by theSSLContextproduced from this class as well as to theSSLContextitself.- 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 toSSLServerSocketFactorys andSSLEngines produced by theSSLContextproduced from this class as well as to theSSLContextitself.- 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()) ornullto use the highest priority provider implementing the secure socket protocol- See Also:
-
getSecureSocketProtocol
-
setSecureSocketProtocol
Sets the optional protocol for the secure sockets created by theSSLContextrepresented by this instance's configuration. Defaults to TLS. See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html- Parameters:
secureSocketProtocol- the name of the protocol ornullto 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 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
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<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<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:
-
getSSLServerSocketFactoryConfigurers
protected List<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:
-
toString
-