Interface DtlsConnection.Builder<B extends Builder<B>>

All Superinterfaces:
BuilderInterface
Enclosing interface:
DtlsConnection

public static interface DtlsConnection.Builder<B extends Builder<B>> extends BuilderInterface
Since:
2.48
  • Method Details

    • setAdvertisedProtocols

      default B setAdvertisedProtocols(String[] advertisedProtocols)
      The list of application-layer protocols that the connection advertises that it is willing to speak. See g_dtls_connection_set_advertised_protocols().
      Parameters:
      advertisedProtocols - the value for the advertised-protocols property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.60
    • setBaseSocket

      default B setBaseSocket(DatagramBased baseSocket)
      The GDatagramBased that the connection wraps. Note that this may be any implementation of GDatagramBased, not just a GSocket.
      Parameters:
      baseSocket - the value for the base-socket property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.48
    • setCertificate

      default B setCertificate(TlsCertificate certificate)
      The connection's certificate; see g_dtls_connection_set_certificate().
      Parameters:
      certificate - the value for the certificate property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.48
    • setDatabase

      default B setDatabase(TlsDatabase database)

      The certificate database to use when verifying this TLS connection. If no certificate database is set, then the default database will be used. See g_tls_backend_get_default_database().

      When using a non-default database, GDtlsConnection must fall back to using the GTlsDatabase to perform certificate verification using g_tls_database_verify_chain(), which means certificate verification will not be able to make use of TLS session context. This may be less secure. For example, if you create your own GTlsDatabase that just wraps the default GTlsDatabase, you might expect that you have not changed anything, but this is not true because you may have altered the behavior of GDtlsConnection by causing it to use g_tls_database_verify_chain(). See the documentation of g_tls_database_verify_chain() for more details on specific security checks that may not be performed. Accordingly, setting a non-default database is discouraged except for specialty applications with unusual security requirements.

      Parameters:
      database - the value for the database property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.48
    • setInteraction

      default B setInteraction(TlsInteraction interaction)
      A GTlsInteraction object to be used when the connection or certificate database need to interact with the user. This will be used to prompt the user for passwords where necessary.
      Parameters:
      interaction - the value for the interaction property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.48
    • setRehandshakeMode

      @Deprecated default B setRehandshakeMode(TlsRehandshakeMode rehandshakeMode)
      Deprecated.
      The rehandshake mode is ignored.
      The rehandshaking mode. See g_dtls_connection_set_rehandshake_mode().
      Parameters:
      rehandshakeMode - the value for the rehandshake-mode property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.48
    • setRequireCloseNotify

      default B setRequireCloseNotify(boolean requireCloseNotify)
      Whether or not proper TLS close notification is required. See g_dtls_connection_set_require_close_notify().
      Parameters:
      requireCloseNotify - the value for the require-close-notify property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.48