Package ch.qos.logback.core.net.ssl
Class SSLParametersConfiguration
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.net.ssl.SSLParametersConfiguration
-
- All Implemented Interfaces:
ContextAware
public class SSLParametersConfiguration extends ContextAwareBase
A configuration of SSL parameters for anSSLEngine
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
enabledCipherSuites
private java.lang.String[]
enabledProtocols
private java.lang.String
excludedCipherSuites
private java.lang.String
excludedProtocols
private java.lang.Boolean
hostnameVerification
private java.lang.String
includedCipherSuites
private java.lang.String
includedProtocols
private java.lang.Boolean
needClientAuth
private java.lang.Boolean
wantClientAuth
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description SSLParametersConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(SSLConfigurable socket)
Configures SSL parameters on anSSLConfigurable
.private java.lang.String[]
enabledCipherSuites(java.lang.String[] supportedCipherSuites, java.lang.String[] defaultCipherSuites)
Gets the set of enabled cipher suites based on the configuration.private java.lang.String[]
enabledProtocols(java.lang.String[] supportedProtocols, java.lang.String[] defaultProtocols)
Gets the set of enabled protocols based on the configuration.java.lang.String
getExcludedCipherSuites()
Gets the JSSE cipher suite names to exclude.java.lang.String
getExcludedProtocols()
Gets the JSSE secure transport protocols to exclude.boolean
getHostnameVerification()
java.lang.String
getIncludedCipherSuites()
Gets the JSSE cipher suite names to include.java.lang.String
getIncludedProtocols()
Gets the JSSE secure transport protocols to include.private java.lang.String[]
includedStrings(java.lang.String[] defaults, java.lang.String included, java.lang.String excluded)
Applies include and exclude patterns to an array of default string values to produce an array of strings included by the patterns.java.lang.Boolean
isNeedClientAuth()
Gets a flag indicating whether client authentication is required.java.lang.Boolean
isWantClientAuth()
Gets a flag indicating whether client authentication is desired.void
setExcludedCipherSuites(java.lang.String cipherSuites)
Sets the JSSE cipher suite names to exclude.void
setExcludedProtocols(java.lang.String protocols)
Sets the JSSE secure transport protocols to exclude.void
setHostnameVerification(boolean hostnameVerification)
void
setIncludedCipherSuites(java.lang.String cipherSuites)
Sets the JSSE cipher suite names to include.void
setIncludedProtocols(java.lang.String protocols)
Sets the JSSE secure transport protocols to include.void
setNeedClientAuth(java.lang.Boolean needClientAuth)
Sets a flag indicating whether client authentication is required.void
setWantClientAuth(java.lang.Boolean wantClientAuth)
Sets a flag indicating whether client authentication is desired.private java.lang.String[]
stringToArray(java.lang.String s)
Splits a string containing comma-separated values into an array.-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Field Detail
-
includedProtocols
private java.lang.String includedProtocols
-
excludedProtocols
private java.lang.String excludedProtocols
-
includedCipherSuites
private java.lang.String includedCipherSuites
-
excludedCipherSuites
private java.lang.String excludedCipherSuites
-
needClientAuth
private java.lang.Boolean needClientAuth
-
wantClientAuth
private java.lang.Boolean wantClientAuth
-
enabledProtocols
private java.lang.String[] enabledProtocols
-
enabledCipherSuites
private java.lang.String[] enabledCipherSuites
-
hostnameVerification
private java.lang.Boolean hostnameVerification
-
-
Method Detail
-
configure
public void configure(SSLConfigurable socket)
Configures SSL parameters on anSSLConfigurable
.- Parameters:
socket
- the subject configurable
-
getHostnameVerification
public boolean getHostnameVerification()
-
setHostnameVerification
public void setHostnameVerification(boolean hostnameVerification)
-
enabledProtocols
private java.lang.String[] enabledProtocols(java.lang.String[] supportedProtocols, java.lang.String[] defaultProtocols)
Gets the set of enabled protocols based on the configuration.- Parameters:
supportedProtocols
- protocols supported by the SSL enginedefaultProtocols
- default protocols enabled by the SSL engine- Returns:
- enabled protocols
-
enabledCipherSuites
private java.lang.String[] enabledCipherSuites(java.lang.String[] supportedCipherSuites, java.lang.String[] defaultCipherSuites)
Gets the set of enabled cipher suites based on the configuration.- Parameters:
supportedCipherSuites
- cipher suites supported by the SSL enginedefaultCipherSuites
- default cipher suites enabled by the SSL engine- Returns:
- enabled cipher suites
-
includedStrings
private java.lang.String[] includedStrings(java.lang.String[] defaults, java.lang.String included, java.lang.String excluded)
Applies include and exclude patterns to an array of default string values to produce an array of strings included by the patterns.- Parameters:
defaults
- default list of string valuesincluded
- comma-separated patterns that identity values to includeexcluded
- comma-separated patterns that identity string to exclude- Returns:
- an array of strings containing those strings from
defaults
that match at least one pattern inincluded
that are not matched by any pattern inexcluded
-
stringToArray
private java.lang.String[] stringToArray(java.lang.String s)
Splits a string containing comma-separated values into an array.- Parameters:
s
- the subject string- Returns:
- array of values contained in
s
-
getIncludedProtocols
public java.lang.String getIncludedProtocols()
Gets the JSSE secure transport protocols to include.- Returns:
- a string containing comma-separated JSSE secure transport
protocol names (e.g.
TLSv1
)
-
setIncludedProtocols
public void setIncludedProtocols(java.lang.String protocols)
Sets the JSSE secure transport protocols to include.- Parameters:
protocols
- a string containing comma-separated JSSE secure transport protocol names- See Also:
Cryptography Architecture Standard Algorithm Name Documentation
-
getExcludedProtocols
public java.lang.String getExcludedProtocols()
Gets the JSSE secure transport protocols to exclude.- Returns:
- a string containing comma-separated JSSE secure transport
protocol names (e.g.
TLSv1
)
-
setExcludedProtocols
public void setExcludedProtocols(java.lang.String protocols)
Sets the JSSE secure transport protocols to exclude.- Parameters:
protocols
- a string containing comma-separated JSSE secure transport protocol names- See Also:
Cryptography Architecture Standard Algorithm Name Documentation
-
getIncludedCipherSuites
public java.lang.String getIncludedCipherSuites()
Gets the JSSE cipher suite names to include.- Returns:
- a string containing comma-separated JSSE cipher suite names
(e.g.
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
)
-
setIncludedCipherSuites
public void setIncludedCipherSuites(java.lang.String cipherSuites)
Sets the JSSE cipher suite names to include.- Parameters:
cipherSuites
- a string containing comma-separated JSSE cipher suite names- See Also:
Cryptography Architecture Standard Algorithm Name Documentation
-
getExcludedCipherSuites
public java.lang.String getExcludedCipherSuites()
Gets the JSSE cipher suite names to exclude.- Returns:
- a string containing comma-separated JSSE cipher suite names
(e.g.
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
)
-
setExcludedCipherSuites
public void setExcludedCipherSuites(java.lang.String cipherSuites)
Sets the JSSE cipher suite names to exclude.- Parameters:
cipherSuites
- a string containing comma-separated JSSE cipher suite names- See Also:
Cryptography Architecture Standard Algorithm Name Documentation
-
isNeedClientAuth
public java.lang.Boolean isNeedClientAuth()
Gets a flag indicating whether client authentication is required.- Returns:
- flag state
-
setNeedClientAuth
public void setNeedClientAuth(java.lang.Boolean needClientAuth)
Sets a flag indicating whether client authentication is required.- Parameters:
needClientAuth
- the flag state to set
-
isWantClientAuth
public java.lang.Boolean isWantClientAuth()
Gets a flag indicating whether client authentication is desired.- Returns:
- flag state
-
setWantClientAuth
public void setWantClientAuth(java.lang.Boolean wantClientAuth)
Sets a flag indicating whether client authentication is desired.- Parameters:
wantClientAuth
- the flag state to set
-
-