Interface DtlsConnection.Builder<B extends Builder<B>>
-
Method Summary
Modifier and TypeMethodDescriptiondefault B
setAdvertisedProtocols
(String[] advertisedProtocols) The list of application-layer protocols that the connection advertises that it is willing to speak.default B
setBaseSocket
(DatagramBased baseSocket) TheGDatagramBased
that the connection wraps.default B
setCertificate
(TlsCertificate certificate) The connection's certificate; see g_dtls_connection_set_certificate().default B
setDatabase
(TlsDatabase database) The certificate database to use when verifying this TLS connection.default B
setInteraction
(TlsInteraction interaction) AGTlsInteraction
object to be used when the connection or certificate database need to interact with the user.default B
setRehandshakeMode
(TlsRehandshakeMode rehandshakeMode) Deprecated.default B
setRequireCloseNotify
(boolean requireCloseNotify) Whether or not proper TLS close notification is required.Methods inherited from interface io.github.jwharm.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
-
Method Details
-
setAdvertisedProtocols
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 theadvertised-protocols
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setBaseSocket
TheGDatagramBased
that the connection wraps. Note that this may be any implementation ofGDatagramBased
, not just aGSocket
.- Parameters:
baseSocket
- the value for thebase-socket
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setCertificate
The connection's certificate; see g_dtls_connection_set_certificate().- Parameters:
certificate
- the value for thecertificate
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDatabase
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 theGTlsDatabase
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 ownGTlsDatabase
that just wraps the defaultGTlsDatabase
, you might expect that you have not changed anything, but this is not true because you may have altered the behavior ofGDtlsConnection
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 thedatabase
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setInteraction
AGTlsInteraction
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 theinteraction
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setRehandshakeMode
Deprecated.The rehandshaking mode. See g_dtls_connection_set_rehandshake_mode().- Parameters:
rehandshakeMode
- the value for therehandshake-mode
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setRequireCloseNotify
Whether or not proper TLS close notification is required. See g_dtls_connection_set_require_close_notify().- Parameters:
requireCloseNotify
- the value for therequire-close-notify
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-