Interface ConnectionSettings.TlsSettings<T>

Type Parameters:
T -
Enclosing interface:
ConnectionSettings<T>

public static interface ConnectionSettings.TlsSettings<T>
TLS settings.
  • Method Details

    • hostnameVerification

      ConnectionSettings.TlsSettings<T> hostnameVerification()
      Activate hostname verification.

      Activated by default.

      Returns:
      TLS settings
    • hostnameVerification

      ConnectionSettings.TlsSettings<T> hostnameVerification(boolean hostnameVerification)
      Whether to activate hostname verification or not.

      Activated by default.

      Parameters:
      hostnameVerification - activation flag
      Returns:
      TLS settings
    • sslContext

      ConnectionSettings.TlsSettings<T> sslContext(SSLContext sslContext)
      SSLContext to use.
      Parameters:
      sslContext - the SSL context to use
      Returns:
      TLS settings
    • ciphers

      ConnectionSettings.TlsSettings<T> ciphers(String... ciphers)
      The cipher suites to enable, in order of preference.
      Parameters:
      ciphers - cipher suites to enable
      Returns:
      TLS settings
    • namedGroups

      ConnectionSettings.TlsSettings<T> namedGroups(String... namedGroups)
      The named groups to enable, in order of preference.

      This will be applied only for Java 20 and more.

      Parameters:
      namedGroups - named groups to enable
      Returns:
      TLS settings
      See Also:
    • sslEngineCustomizer

      ConnectionSettings.TlsSettings<T> sslEngineCustomizer(Consumer<SSLEngine> customizer)
      Callback to customize the SSLEngine used for the connection.

      The callback is called after the library has applied its own initialization of the engine, so it can be used to override the settings the library sets by default.

      This is an advanced extension point, most applications should not need it.

      Parameters:
      customizer - the customizer
      Returns:
      TLS settings
    • trustEverything

      ConnectionSettings.TlsSettings<T> trustEverything()
      Convenience method to set a SSLContext that trusts all servers.

      When this feature is enabled, no peer verification is performed, which provides no protection against Man-in-the-Middle (MITM) attacks.

      Use this only in development and QA environments.

      Returns:
      TLS settings
    • connection

      T connection()
      The connection builder.
      Returns:
      connection builder