( since = "2.48"
) ]public interface DtlsConnection
DtlsConnection is the base DTLS connection class type, which wraps a
DatagramBased and provides DTLS encryption on top of it.
Its subclasses, DtlsClientConnection and
DtlsServerConnection, implement client-side and server-side DTLS,
For TLS support, see TlsConnection.
As DTLS is datagram based, DtlsConnection implements
DatagramBased, presenting a datagram-socket-like API for the encrypted
connection. This operates over a base datagram connection, which is also a
To close a DTLS connection, use close.
Neither DtlsServerConnection or
DtlsClientConnection set the peer address on their base
DatagramBased if it is a
Socket — it is up to the caller to do that if they wish. If they do not, and
close is called on the base socket, the DtlsConnection will not raise a
g_io_error_not_connected error on further I/O.
All known sub-interfaces:
- public bool close (Cancellable? cancellable = null) throws Error
Close the DTLS connection.
- public async bool close_async (int io_priority = DEFAULT, Cancellable? cancellable = null) throws Error
Asynchronously close the DTLS connection.
- public bool emit_accept_certificate (TlsCertificate peer_cert, TlsCertificateFlags errors)
- public weak TlsCertificate get_certificate ()
- public weak TlsDatabase get_database ()
Gets the certificate database that this
uses to verify peer certificates.
- public weak TlsInteraction get_interaction ()
Get the object that will be used to interact with the user.
- public weak TlsCertificate get_peer_certificate ()
Gets this's peer's certificate after the
handshake has completed.
- public TlsCertificateFlags get_peer_certificate_errors ()
Gets the errors associated with validating this
's peer's certificate, after the handshake has completed.
- public TlsRehandshakeMode get_rehandshake_mode ()
Gets this rehandshaking mode.
- public bool get_require_close_notify ()
Tests whether or not this expects a proper
TLS close notification when the connection is closed.
- public abstract bool handshake (Cancellable? cancellable = null) throws Error
Attempts a TLS handshake on this.
- public abstract async bool handshake_async (int io_priority = DEFAULT, Cancellable? cancellable = null) throws Error
Asynchronously performs a TLS handshake on this
- public void set_certificate (TlsCertificate certificate)
This sets the certificate that this will
present to its peer during the TLS handshake.
- public void set_database (TlsDatabase database)
Sets the certificate database that is used to verify peer certificates.
- public void set_interaction (TlsInteraction? interaction)
Set the object that will be used to interact with the user.
- public void set_rehandshake_mode (TlsRehandshakeMode mode)
Sets how this behaves with respect to
- public void set_require_close_notify (bool require_close_notify)
Sets whether or not this expects a proper
TLS close notification before the connection is closed.
- public abstract bool shutdown (bool shutdown_read, bool shutdown_write, Cancellable? cancellable = null) throws Error
Shut down part or all of a DTLS connection.
- public abstract async bool shutdown_async (bool shutdown_read, bool shutdown_write, int io_priority = DEFAULT, Cancellable? cancellable = null) throws Error
Asynchronously shut down part or all of the DTLS connection.
All known members inherited from class GLib.Object
All known members inherited from interface GLib.DatagramBased