Package org.apache.camel.support.jsse
Class BaseSSLContextParameters
java.lang.Object
org.apache.camel.support.jsse.JsseParameters
org.apache.camel.support.jsse.BaseSSLContextParameters
- All Implemented Interfaces:
CamelContextAware
,HasCamelContext
- Direct Known Subclasses:
SSLContextClientParameters
,SSLContextParameters
,SSLContextServerParameters
Represents configuration options that can be applied in the client-side or server-side context depending on what they
are applied to.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
Makes a decoratedSSLContext
appear as a normalSSLContext
.protected static final class
Class needed to provide decoration of an existingSSLContext
.protected static final class
A decorator that enables the application of configuration options to be applied to created sockets even after this factory has been created and turned over to client code.protected static final class
A decorator that enables the application of configuration options to be applied to created sockets even after this factory has been created and turned over to client code. -
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureSessionContext
(SSLSessionContext sessionContext, String sessionTimeout) Configures aSSLSessionContext
, client or server, with the supplied session timeout.protected void
configureSSLContext
(SSLContext context) Configures the actualSSLContext
itself with direct setter calls.protected Collection<String>
filter
(Collection<String> explicitValues, Collection<String> availableValues, Collection<String> currentValues, FilterParameters.Patterns patterns, FilterParameters.Patterns defaultPatterns, boolean applyDefaults) Filters the values inavailableValues
returning only the values that are explicitly listed inexplicitValues
(returns them regardless of if they appear inavailableValues
or not) ifexplicitValues
is notnull
or according to the following rules: Match the include patterns inpatterns
and don't match the exclude patterns inpatterns
if patterns is notnull
. Match the include patterns indefaultPatterns
and don't match the exclude patterns indefaultPatterns
if patterns isnull
andapplyDefaults
is true. Are provided in currentValues if if patterns isnull
andapplyDefaults
is false.protected Collection<String>
filter
(Collection<String> explicitValues, Collection<String> availableValues, List<Pattern> includePatterns, List<Pattern> excludePatterns) Filters the values inavailableValues
returning only the values that are explicitly listed inexplicitValues
(returns them regardless of if they appear inavailableValues
or not) ifexplicitValues
is notnull
or as match the patterns inincludePatterns
and do not match the patterns inexcludePatterns
ifexplicitValues
isnull
.protected boolean
Returns a flag indicating if default values should be applied in the event that no other property of the instance configures a particular aspect of the entity produced by the instance.Returns the optional explicitly configured cipher suites for this configuration.Returns the optional cipher suite filter for this configuration.protected FilterParameters
protected FilterParameters
Returns the explicitly configured secure socket protocol names for this configuration.Returns the optional secure socket protocol filter for this configuration.Returns the optionalSSLSessionContext
timeout time forSSLSession
s in seconds.protected List<SNIServerName>
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>>
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<SSLServerSocket>>
Returns the list of configurers to apply to anSSLServerSocket
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.Returns the list of configurers to apply to anSSLSocket
in order to fully configure it in compliance with the provided configuration options.protected boolean
matchesOneOf
(String value, List<Pattern> patterns) Returns true if and only if the value is matched by one or more of the supplied patterns.void
setCipherSuites
(CipherSuitesParameters cipherSuites) Sets the optional explicitly configured cipher suites for this configuration.void
setCipherSuitesFilter
(FilterParameters cipherSuitesFilter) Sets the optional cipher suite filter for this JSSE configuration.void
setSecureSocketProtocols
(SecureSocketProtocolsParameters secureSocketProtocols) Sets the explicitly configured secure socket protocol names for this configuration.void
setSecureSocketProtocolsFilter
(FilterParameters secureSocketProtocolsFilter) Sets the optional secure socket protocol filter for this JSSE configuration.void
setSessionTimeout
(String sessionTimeout) Sets the optionalSSLSessionContext
timeout time forSSLSession
s in seconds.Methods inherited from class org.apache.camel.support.jsse.JsseParameters
getCamelContext, parsePropertyValue, parsePropertyValues, resolveResource, setCamelContext
-
Field Details
-
DEFAULT_CIPHER_SUITES_FILTER_INCLUDE
-
DEFAULT_CIPHER_SUITES_FILTER_EXCLUDE
-
DEFAULT_SECURE_SOCKET_PROTOCOLS_FILTER_INCLUDE
-
DEFAULT_SECURE_SOCKET_PROTOCOLS_FILTER_EXCLUDE
-
-
Constructor Details
-
BaseSSLContextParameters
public BaseSSLContextParameters()
-
-
Method Details
-
getSNIHostNames
-
getCipherSuites
Returns the optional explicitly configured cipher suites for this configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values override any filters supplied insetCipherSuitesFilter(FilterParameters)
-
setCipherSuites
Sets the optional explicitly configured cipher suites for this configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values override any filters supplied insetCipherSuitesFilter(FilterParameters)
- Parameters:
cipherSuites
- the suite configuration
-
getCipherSuitesFilter
Returns the optional cipher suite filter for this configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values are ignored ifsetCipherSuites(CipherSuitesParameters)
is called with a nonnull
argument. -
setCipherSuitesFilter
Sets the optional cipher suite filter for this JSSE configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values are ignored ifsetCipherSuites(CipherSuitesParameters)
is called with a nonnull
argument.- Parameters:
cipherSuitesFilter
- the filter configuration
-
getSecureSocketProtocols
Returns the explicitly configured secure socket protocol names for this configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values override any filters supplied insetSecureSocketProtocolsFilter(FilterParameters)
-
setSecureSocketProtocols
Sets the explicitly configured secure socket protocol names for this configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values override any filters supplied insetSecureSocketProtocolsFilter(FilterParameters)
-
getSecureSocketProtocolsFilter
Returns the optional secure socket protocol filter for this configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values are ignored ifsetSecureSocketProtocols(SecureSocketProtocolsParameters)
is called with a non-null
argument. -
setSecureSocketProtocolsFilter
Sets the optional secure socket protocol filter for this JSSE configuration. These options are used in the configuration ofSSLEngine
,SSLSocketFactory
andSSLServerSocketFactory
depending on the context in which they are applied. These values are ignored ifsetSecureSocketProtocols(SecureSocketProtocolsParameters)
is called with a non-null
argument.- Parameters:
secureSocketProtocolsFilter
- the filter configuration
-
getSessionTimeout
Returns the optionalSSLSessionContext
timeout time forSSLSession
s in seconds. -
setSessionTimeout
Sets the optionalSSLSessionContext
timeout time forSSLSession
s in seconds.- Parameters:
sessionTimeout
- the timeout value ornull
to use the default
-
getAllowPassthrough
protected boolean getAllowPassthrough()Returns a flag indicating if default values should be applied in the event that no other property of the instance configures a particular aspect of the entity produced by the instance. This flag is used to allow instances of this class to produce a configurer that simply passes through the current configuration of a configured entity when the instance of this class would otherwise only apply some default configuration. -
configureSSLContext
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.- Parameters:
context
- the context to configure- Throws:
GeneralSecurityException
- if there is an error configuring the context
-
getDefaultCipherSuitesFilter
-
getDefaultSecureSocketProcotolFilter
-
getSSLEngineConfigurers
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. The configurers are to be applied in the order in which they appear in the list.- 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) 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 usegetSSLSocketFactorySSLSocketConfigurers(SSLContext)
instead of this method asSSLSocketFactory
does not contain any configuration options that are non-proprietary.- Parameters:
context
- the context that serves as the factory forSSLSocketFactory
instances- Returns:
- the needed configurers
- See Also:
-
getSSLServerSocketFactoryConfigurers
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. The configurers are to be applied in the order in which they appear in the list. It is preferred to usegetSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext)
instead of this method asSSLServerSocketFactory
does not contain any configuration options that are non-proprietary.- Parameters:
context
- the context that serves as the factory forSSLServerSocketFactory
instances- Returns:
- the needed configurers
- See Also:
-
getSSLSocketFactorySSLSocketConfigurers
protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLSocket>> getSSLSocketFactorySSLSocketConfigurers(SSLContext context) Returns the list of configurers to apply to anSSLSocket
in order to fully configure it in compliance with the provided configuration options. These configurers are intended for sockets produced by aSSLSocketFactory
, seegetSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext)
for configurers related to sockets produced by aSSLServerSocketFactory
. The configurers are to be applied in the order in which they appear in the list.- Parameters:
context
- the context that serves as the factory forSSLSocketFactory
instances- Returns:
- the needed configurers
-
getSSLServerSocketFactorySSLServerSocketConfigurers
protected List<org.apache.camel.support.jsse.BaseSSLContextParameters.Configurer<SSLServerSocket>> getSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext context) Returns the list of configurers to apply to anSSLServerSocket
in order to fully configure it in compliance with the provided configuration options. These configurers are intended for sockets produced by aSSLServerSocketFactory
, seegetSSLSocketFactorySSLSocketConfigurers(SSLContext)
for configurers related to sockets produced by aSSLSocketFactory
. The configurers are to be applied in the order in which they appear in the list.- Parameters:
context
- the context that serves as the factory forSSLServerSocketFactory
instances- Returns:
- the needed configurers
-
configureSessionContext
protected void configureSessionContext(SSLSessionContext sessionContext, String sessionTimeout) throws GeneralSecurityException Configures aSSLSessionContext
, client or server, with the supplied session timeout.- Parameters:
sessionContext
- the context to configuresessionTimeout
- the timeout time period- Throws:
GeneralSecurityException
- ifsessionContext
isnull
-
filter
protected Collection<String> filter(Collection<String> explicitValues, Collection<String> availableValues, Collection<String> currentValues, FilterParameters.Patterns patterns, FilterParameters.Patterns defaultPatterns, boolean applyDefaults) Filters the values inavailableValues
returning only the values that are explicitly listed inexplicitValues
(returns them regardless of if they appear inavailableValues
or not) ifexplicitValues
is notnull
or according to the following rules:- Match the include patterns in
patterns
and don't match the exclude patterns inpatterns
if patterns is notnull
. - Match the include patterns in
defaultPatterns
and don't match the exclude patterns indefaultPatterns
if patterns isnull
andapplyDefaults
is true. - Are provided in currentValues if if patterns is
null
andapplyDefaults
is false.
- Parameters:
explicitValues
- the optional explicit values to useavailableValues
- the available values to filter frompatterns
- the optional patterns to use whenexplicitValues
is not useddefaultPatterns
- the required patterns to use whenexplicitValues
andpatterns
are not usedapplyDefaults
- flag indicating whether or not to apply defaults in the event that no explicit values and no patterns apply- Returns:
- the filtered values
- See Also:
- Match the include patterns in
-
filter
protected Collection<String> filter(Collection<String> explicitValues, Collection<String> availableValues, List<Pattern> includePatterns, List<Pattern> excludePatterns) Filters the values inavailableValues
returning only the values that are explicitly listed inexplicitValues
(returns them regardless of if they appear inavailableValues
or not) ifexplicitValues
is notnull
or as match the patterns inincludePatterns
and do not match the patterns inexcludePatterns
ifexplicitValues
isnull
.- Parameters:
explicitValues
- the optional explicit values to useavailableValues
- the available values to filter from ifexplicitValues
isnull
includePatterns
- the patterns to use for inclusion filtering, required ifexplicitValues
isnull
excludePatterns
- the patterns to use for exclusion filtering, required ifexplicitValues
isnull
- Returns:
- the filtered values
-
matchesOneOf
Returns true if and only if the value is matched by one or more of the supplied patterns.- Parameters:
value
- the value to matchpatterns
- the patterns to try to match against
-