Package org.apache.qpid.protonj2.client
Class SslOptions
- java.lang.Object
-
- org.apache.qpid.protonj2.client.SslOptions
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SslOptions extends java.lang.Object implements java.lang.CloneableOptions for configuration of the client SSL layer
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ALLOW_NATIVE_SSLstatic java.lang.StringDEFAULT_CONTEXT_PROTOCOLstatic java.util.List<java.lang.String>DEFAULT_DISABLED_PROTOCOLSstatic intDEFAULT_SSL_PORTstatic java.lang.StringDEFAULT_STORE_TYPEstatic booleanDEFAULT_TRUST_ALLstatic booleanDEFAULT_VERIFY_HOST
-
Constructor Summary
Constructors Constructor Description SslOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowNativeSSL()SslOptionsallowNativeSSL(boolean allowNativeSSL)SslOptionsclone()java.lang.StringcontextProtocol()SslOptionscontextProtocol(java.lang.String contextProtocol)The protocol value to use when creating an SSLContext via SSLContext.getInstance(protocol).SslOptionscopyInto(SslOptions other)Copy all configuration into the givenSslOptionsfrom this instance.intdefaultSslPort()SslOptionsdefaultSslPort(int defaultSslPort)Sets the default AMQP SSL port that should be used if the user did not provide a port value.java.lang.String[]disabledCipherSuites()SslOptionsdisabledCipherSuites(java.lang.String... disabledCipherSuites)java.lang.String[]disabledProtocols()SslOptionsdisabledProtocols(java.lang.String... disabledProtocols)The protocols to be disable.java.lang.String[]enabledCipherSuites()SslOptionsenabledCipherSuites(java.lang.String... enabledCipherSuites)java.lang.String[]enabledProtocols()SslOptionsenabledProtocols(java.lang.String... enabledProtocols)The protocols to be set as enabled.java.lang.StringkeyAlias()SslOptionskeyAlias(java.lang.String keyAlias)java.lang.StringkeyStoreLocation()SslOptionskeyStoreLocation(java.lang.String keyStoreLocation)Sets the location on disk of the key store to use.java.lang.StringkeyStorePassword()SslOptionskeyStorePassword(java.lang.String keyStorePassword)java.lang.StringkeyStoreType()SslOptionskeyStoreType(java.lang.String keyStoreType)javax.net.ssl.SSLContextsslContextOverride()SslOptionssslContextOverride(javax.net.ssl.SSLContext sslContextOverride)Provides a user configuredSSLContextthat should be used when performing the SSL handshake with the remote.booleansslEnabled()SslOptionssslEnabled(boolean enable)Enable or disable the transport level SSL encryption layer.SslOptionsstoreType(java.lang.String storeType)booleantrustAll()SslOptionstrustAll(boolean trustAll)java.lang.StringtrustStoreLocation()SslOptionstrustStoreLocation(java.lang.String trustStoreLocation)java.lang.StringtrustStorePassword()SslOptionstrustStorePassword(java.lang.String trustStorePassword)java.lang.StringtrustStoreType()SslOptionstrustStoreType(java.lang.String trustStoreType)booleanverifyHost()SslOptionsverifyHost(boolean verifyHost)
-
-
-
Field Detail
-
DEFAULT_STORE_TYPE
public static final java.lang.String DEFAULT_STORE_TYPE
- See Also:
- Constant Field Values
-
DEFAULT_CONTEXT_PROTOCOL
public static final java.lang.String DEFAULT_CONTEXT_PROTOCOL
- See Also:
- Constant Field Values
-
DEFAULT_TRUST_ALL
public static final boolean DEFAULT_TRUST_ALL
- See Also:
- Constant Field Values
-
DEFAULT_VERIFY_HOST
public static final boolean DEFAULT_VERIFY_HOST
- See Also:
- Constant Field Values
-
DEFAULT_DISABLED_PROTOCOLS
public static final java.util.List<java.lang.String> DEFAULT_DISABLED_PROTOCOLS
-
DEFAULT_SSL_PORT
public static final int DEFAULT_SSL_PORT
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_NATIVE_SSL
public static final boolean DEFAULT_ALLOW_NATIVE_SSL
- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
public SslOptions clone()
- Overrides:
clonein classjava.lang.Object
-
sslEnabled
public boolean sslEnabled()
- Returns:
- true if the client transport will attempt to connect with SSL
-
sslEnabled
public SslOptions sslEnabled(boolean enable)
Enable or disable the transport level SSL encryption layer.- Parameters:
enable- boolean that controls if SSL is enabled or disabled.- Returns:
- this
SslOptionsinstance.
-
keyStoreLocation
public java.lang.String keyStoreLocation()
- Returns:
- the keyStoreLocation currently configured.
-
keyStoreLocation
public SslOptions keyStoreLocation(java.lang.String keyStoreLocation)
Sets the location on disk of the key store to use.- Parameters:
keyStoreLocation- the keyStoreLocation to use to create the key manager.- Returns:
- this options instance.
-
keyStorePassword
public java.lang.String keyStorePassword()
- Returns:
- the keyStorePassword
-
keyStorePassword
public SslOptions keyStorePassword(java.lang.String keyStorePassword)
- Parameters:
keyStorePassword- the keyStorePassword to set- Returns:
- this options instance.
-
trustStoreLocation
public java.lang.String trustStoreLocation()
- Returns:
- the trustStoreLocation
-
trustStoreLocation
public SslOptions trustStoreLocation(java.lang.String trustStoreLocation)
- Parameters:
trustStoreLocation- the trustStoreLocation to set- Returns:
- this options instance.
-
trustStorePassword
public java.lang.String trustStorePassword()
- Returns:
- the trustStorePassword
-
trustStorePassword
public SslOptions trustStorePassword(java.lang.String trustStorePassword)
- Parameters:
trustStorePassword- the trustStorePassword to set- Returns:
- this options instance.
-
storeType
public SslOptions storeType(java.lang.String storeType)
- Parameters:
storeType- the format that the store files are encoded in.- Returns:
- this options instance.
-
keyStoreType
public java.lang.String keyStoreType()
- Returns:
- the keyStoreType
-
keyStoreType
public SslOptions keyStoreType(java.lang.String keyStoreType)
- Parameters:
keyStoreType- the format that the keyStore file is encoded in- Returns:
- this options instance.
-
trustStoreType
public java.lang.String trustStoreType()
- Returns:
- the trustStoreType
-
trustStoreType
public SslOptions trustStoreType(java.lang.String trustStoreType)
- Parameters:
trustStoreType- the format that the trustStore file is encoded in- Returns:
- this options instance.
-
enabledCipherSuites
public java.lang.String[] enabledCipherSuites()
- Returns:
- the enabledCipherSuites
-
enabledCipherSuites
public SslOptions enabledCipherSuites(java.lang.String... enabledCipherSuites)
- Parameters:
enabledCipherSuites- the enabledCipherSuites to set- Returns:
- this options instance.
-
disabledCipherSuites
public java.lang.String[] disabledCipherSuites()
- Returns:
- the disabledCipherSuites
-
disabledCipherSuites
public SslOptions disabledCipherSuites(java.lang.String... disabledCipherSuites)
- Parameters:
disabledCipherSuites- the disabledCipherSuites to set- Returns:
- this options instance.
-
enabledProtocols
public java.lang.String[] enabledProtocols()
- Returns:
- the enabledProtocols or null if the defaults should be used
-
enabledProtocols
public SslOptions enabledProtocols(java.lang.String... enabledProtocols)
The protocols to be set as enabled.- Parameters:
enabledProtocols- the enabled protocols to set, or null if the defaults should be used.- Returns:
- this options instance.
-
disabledProtocols
public java.lang.String[] disabledProtocols()
- Returns:
- the protocols to disable or null if none should be
-
disabledProtocols
public SslOptions disabledProtocols(java.lang.String... disabledProtocols)
The protocols to be disable.- Parameters:
disabledProtocols- the protocols to disable, or null if none should be.- Returns:
- this options instance.
-
contextProtocol
public java.lang.String contextProtocol()
- Returns:
- the context protocol to use
-
contextProtocol
public SslOptions contextProtocol(java.lang.String contextProtocol)
The protocol value to use when creating an SSLContext via SSLContext.getInstance(protocol).- Parameters:
contextProtocol- the context protocol to use.- Returns:
- this options instance.
-
trustAll
public boolean trustAll()
- Returns:
- the trustAll
-
trustAll
public SslOptions trustAll(boolean trustAll)
- Parameters:
trustAll- the trustAll to set- Returns:
- this options instance.
-
verifyHost
public boolean verifyHost()
- Returns:
- the verifyHost
-
verifyHost
public SslOptions verifyHost(boolean verifyHost)
- Parameters:
verifyHost- the verifyHost to set- Returns:
- this options instance.
-
keyAlias
public java.lang.String keyAlias()
- Returns:
- the key alias
-
keyAlias
public SslOptions keyAlias(java.lang.String keyAlias)
- Parameters:
keyAlias- the key alias to use- Returns:
- this options instance.
-
defaultSslPort
public int defaultSslPort()
- Returns:
- the currently configured default SSL port.
-
defaultSslPort
public SslOptions defaultSslPort(int defaultSslPort)
Sets the default AMQP SSL port that should be used if the user did not provide a port value.- Parameters:
defaultSslPort- the default AMQP SSL port to use when none provided by the user.- Returns:
- this
SslOptionsinstance.
-
sslContextOverride
public javax.net.ssl.SSLContext sslContextOverride()
- Returns:
- the currently configured
SSLContextoverride or null if none set.
-
sslContextOverride
public SslOptions sslContextOverride(javax.net.ssl.SSLContext sslContextOverride)
Provides a user configuredSSLContextthat should be used when performing the SSL handshake with the remote.- Parameters:
sslContextOverride- User definedSSLContextused for authentication.- Returns:
- this
SslOptionsinstance.
-
allowNativeSSL
public boolean allowNativeSSL()
- Returns:
- true if the an native SSL based encryption layer is allowed to be used instead of the JDK.
-
allowNativeSSL
public SslOptions allowNativeSSL(boolean allowNativeSSL)
- Parameters:
allowNativeSSL- Configure if the transport should attempt to use native SSL support if available.- Returns:
- this options object.
-
copyInto
public SslOptions copyInto(SslOptions other)
Copy all configuration into the givenSslOptionsfrom this instance.- Parameters:
other- anotherSslOptionsinstance that will receive the configuration from this instance.- Returns:
- the options instance that was copied into.
-
-