module Gio::DtlsConnection

Overview

GDtlsConnection is the base DTLS connection class type, which wraps a Gio::DatagramBased and provides DTLS encryption on top of it. Its subclasses, Gio::DtlsClientConnection and Gio::DtlsServerConnection, implement client-side and server-side DTLS, respectively.

For TLS support, see Gio::TlsConnection.

As DTLS is datagram based, GDtlsConnection implements Gio::DatagramBased, presenting a datagram-socket-like API for the encrypted connection. This operates over a base datagram connection, which is also a GDatagramBased ([property@Gio.DtlsConnection:base-socket]).

To close a DTLS connection, use Gio::DtlsConnection#close.

Neither Gio::DtlsServerConnection or Gio::DtlsClientConnection set the peer address on their base Gio::DatagramBased if it is a Gio::Socket — it is up to the caller to do that if they wish. If they do not, and Gio::Socket#close is called on the base socket, the GDtlsConnection will not raise a G_IO_ERROR_NOT_CONNECTED error on further I/O.

Defined in:

lib/gi-crystal/src/auto/gio-2.0/dtls_connection.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.cast(obj : GObject::Object) : self #

Cast a GObject::Object to self, throws a TypeCastError if the cast can't be made.


Class Method Detail

def self.cast?(obj : GObject::Object) : self | Nil #

def self.g_type : UInt64 #

Instance Method Detail

def accept_certificate_signal #

def advertised_protocols : Enumerable(String) #

def advertised_protocols=(value : Enumerable(String)) : Enumerable(String) #

def advertised_protocols=(protocols : Enumerable(String) | Nil) : Nil #

def base_socket : Gio::DatagramBased | Nil #

def base_socket=(value : Gio::DatagramBased | Nil) : Gio::DatagramBased | Nil #

def certificate : Gio::TlsCertificate | Nil #

def certificate=(certificate : Gio::TlsCertificate) : Nil #

def channel_binding_data(type : Gio::TlsChannelBindingType) : Bool #

def ciphersuite_name : String | Nil #

def ciphersuite_name? : String | Nil #

Same as #ciphersuite_name, but can return nil.


def close(cancellable : Gio::Cancellable | Nil) : Bool #

def close_async(io_priority : Int32, cancellable : Gio::Cancellable | Nil, &callback : Gio::AsyncReadyCallback) : Nil #

def close_finish(result : Gio::AsyncResult) : Bool #

def database : Gio::TlsDatabase | Nil #

def database=(database : Gio::TlsDatabase | Nil) : Nil #

def emit_accept_certificate(peer_cert : Gio::TlsCertificate, errors : Gio::TlsCertificateFlags) : Bool #

def handshake(cancellable : Gio::Cancellable | Nil) : Bool #

def handshake_async(io_priority : Int32, cancellable : Gio::Cancellable | Nil, &callback : Gio::AsyncReadyCallback) : Nil #

def handshake_finish(result : Gio::AsyncResult) : Bool #

def interaction : Gio::TlsInteraction | Nil #

def interaction=(interaction : Gio::TlsInteraction | Nil) : Nil #

def negotiated_protocol : String | Nil #

def negotiated_protocol? : String | Nil #

Same as #negotiated_protocol, but can return nil.


def peer_certificate : Gio::TlsCertificate | Nil #

def peer_certificate_errors : Gio::TlsCertificateFlags #

def protocol_version : Gio::TlsProtocolVersion #

def rehandshake_mode : Gio::TlsRehandshakeMode #

DEPRECATED


def rehandshake_mode=(mode : Gio::TlsRehandshakeMode) : Nil #

DEPRECATED


def require_close_notify : Bool #

def require_close_notify=(require_close_notify : Bool) : Nil #

def require_close_notify? : Bool #

def shutdown(shutdown_read : Bool, shutdown_write : Bool, cancellable : Gio::Cancellable | Nil) : Bool #

def shutdown_async(shutdown_read : Bool, shutdown_write : Bool, io_priority : Int32, cancellable : Gio::Cancellable | Nil, &callback : Gio::AsyncReadyCallback) : Nil #

def shutdown_finish(result : Gio::AsyncResult) : Bool #

abstract def to_unsafe #