DtlsConnection
Object Hierarchy:
GLib.DtlsConnection
GLib.DtlsConnection
GLib.DtlsConnection
GLib.Object
GLib.Object
GLib.Object->GLib.DtlsConnection
GLib.DatagramBased
GLib.DatagramBased
GLib.DatagramBased->GLib.DtlsConnection
Description:
[
CCode ( type_cname =
"GDtlsConnectionInterface" , type_id =
"g_dtls_connection_get_type ()" ) ]
[
Version ( since =
"2.48" ) ]
public interface DtlsConnection :
Object ,
DatagramBased
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,
respectively.
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 DatagramBased (
base_socket ).
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:
Content:
Properties:
Methods:
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 unowned TlsCertificate ? get_certificate ()
public virtual bool get_channel_binding_data (TlsChannelBindingType type, out unowned ByteArray data) throws TlsChannelBindingError
Query the TLS backend for TLS channel binding data of type
for this .
public string ? get_ciphersuite_name ()
Returns the name of the current DTLS ciphersuite, or
null if the connection has not handshaked or has been closed.
public unowned TlsDatabase ? get_database ()
Gets the certificate database that this
uses to verify peer certificates.
public unowned TlsInteraction ? get_interaction ()
Get the object that will be used to interact with the user.
public abstract unowned string ? get_negotiated_protocol ()
Gets the name of the application-layer protocol negotiated during the
handshake.
public unowned TlsCertificate ? get_peer_certificate ()
Gets this 's peer's certificate after
the handshake has completed or failed.
public TlsCertificateFlags get_peer_certificate_errors ()
Gets the errors associated with validating
this 's peer's certificate, after the handshake has completed or failed.
public TlsProtocolVersion get_protocol_version ()
Returns the current DTLS protocol version, which may be
g_tls_protocol_version_unknown if the connection has not handshaked, or has been closed, or if the
TLS backend has implemented a protocol version that is not a recognized
TlsProtocolVersion .
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 abstract void set_advertised_protocols (string []? protocols)
Sets the list of application-layer protocols to advertise that the
caller is willing to speak on this connection.
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)
Since GLib 2.64, changing the rehandshake mode is no longer supported
and will have no effect.
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.
Signals:
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface GLib.DatagramBased