Class SslOptions

java.lang.Object
org.apache.qpid.protonj2.client.SslOptions
All Implemented Interfaces:
Cloneable

public class SslOptions extends Object implements Cloneable
Options for configuration of the client SSL layer
  • Field Details

  • Constructor Details

    • SslOptions

      public SslOptions()
  • Method Details

    • clone

      public SslOptions clone()
      Overrides:
      clone in class 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 SslOptions instance.
    • keyStoreLocation

      public String keyStoreLocation()
      Returns:
      the keyStoreLocation currently configured.
    • keyStoreLocation

      public SslOptions keyStoreLocation(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 String keyStorePassword()
      Returns:
      the keyStorePassword
    • keyStorePassword

      public SslOptions keyStorePassword(String keyStorePassword)
      Parameters:
      keyStorePassword - the keyStorePassword to set
      Returns:
      this options instance.
    • trustStoreLocation

      public String trustStoreLocation()
      Returns:
      the trustStoreLocation
    • trustStoreLocation

      public SslOptions trustStoreLocation(String trustStoreLocation)
      Parameters:
      trustStoreLocation - the trustStoreLocation to set
      Returns:
      this options instance.
    • trustStorePassword

      public String trustStorePassword()
      Returns:
      the trustStorePassword
    • trustStorePassword

      public SslOptions trustStorePassword(String trustStorePassword)
      Parameters:
      trustStorePassword - the trustStorePassword to set
      Returns:
      this options instance.
    • storeType

      public SslOptions storeType(String storeType)
      Parameters:
      storeType - the format that the store files are encoded in.
      Returns:
      this options instance.
    • keyStoreType

      public String keyStoreType()
      Returns:
      the keyStoreType
    • keyStoreType

      public SslOptions keyStoreType(String keyStoreType)
      Parameters:
      keyStoreType - the format that the keyStore file is encoded in
      Returns:
      this options instance.
    • trustStoreType

      public String trustStoreType()
      Returns:
      the trustStoreType
    • trustStoreType

      public SslOptions trustStoreType(String trustStoreType)
      Parameters:
      trustStoreType - the format that the trustStore file is encoded in
      Returns:
      this options instance.
    • enabledCipherSuites

      public String[] enabledCipherSuites()
      Returns:
      the enabledCipherSuites
    • enabledCipherSuites

      public SslOptions enabledCipherSuites(String... enabledCipherSuites)
      Parameters:
      enabledCipherSuites - the enabledCipherSuites to set
      Returns:
      this options instance.
    • disabledCipherSuites

      public String[] disabledCipherSuites()
      Returns:
      the disabledCipherSuites
    • disabledCipherSuites

      public SslOptions disabledCipherSuites(String... disabledCipherSuites)
      Parameters:
      disabledCipherSuites - the disabledCipherSuites to set
      Returns:
      this options instance.
    • enabledProtocols

      public String[] enabledProtocols()
      Returns:
      the enabledProtocols or null if the defaults should be used
    • enabledProtocols

      public SslOptions enabledProtocols(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 String[] disabledProtocols()
      Returns:
      the protocols to disable or null if none should be
    • disabledProtocols

      public SslOptions disabledProtocols(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 String contextProtocol()
      Returns:
      the context protocol to use
    • contextProtocol

      public SslOptions contextProtocol(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 String keyAlias()
      Returns:
      the key alias
    • keyAlias

      public SslOptions keyAlias(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 SslOptions instance.
    • sslContextOverride

      public SSLContext sslContextOverride()
      Returns:
      the currently configured SSLContext override or null if none set.
    • sslContextOverride

      public SslOptions sslContextOverride(SSLContext sslContextOverride)
      Provides a user configured SSLContext that should be used when performing the SSL handshake with the remote.
      Parameters:
      sslContextOverride - User defined SSLContext used for authentication.
      Returns:
      this SslOptions instance.
    • 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

      protected SslOptions copyInto(SslOptions other)
      Copy all configuration into the given SslOptions from this instance.
      Parameters:
      other - another SslOptions instance that will receive the configuration from this instance.
      Returns:
      the options instance that was copied into.