DtlsClientConnection#

Added in version 2.48.

class DtlsClientConnection(*args, **kwargs)#

GDtlsClientConnection is the client-side subclass of DtlsConnection, representing a client-side DTLS connection.

Methods#

class DtlsClientConnection
get_accepted_cas() list[Sequence[int]]#

Gets the list of distinguished names of the Certificate Authorities that the server will accept certificates from. This will be set during the TLS handshake if the server requests a certificate. Otherwise, it will be None.

Each item in the list is a GByteArray which contains the complete subject DN of the certificate authority.

Added in version 2.48.

get_server_identity() SocketConnectable#

Gets conn’s expected server identity

Added in version 2.48.

get_validation_flags() TlsCertificateFlags#

Gets conn’s validation flags

This function does not work as originally designed and is impossible to use correctly. See DtlsClientConnection:validation-flags for more information.

Added in version 2.48.

Deprecated since version 2.74: Do not attempt to ignore validation errors.

new(base_socket: DatagramBased, server_identity: SocketConnectable | None = None) DtlsClientConnection#

Creates a new DtlsClientConnection wrapping base_socket which is assumed to communicate with the server identified by server_identity.

Added in version 2.48.

Parameters:
  • base_socket – the DatagramBased to wrap

  • server_identity – the expected identity of the server

set_server_identity(identity: SocketConnectable) None#

Sets conn’s expected server identity, which is used both to tell servers on virtual hosts which certificate to present, and also to let conn know what name to look for in the certificate when performing BAD_IDENTITY validation, if enabled.

Added in version 2.48.

Parameters:

identity – a SocketConnectable describing the expected server identity

set_validation_flags(flags: TlsCertificateFlags) None#

Sets conn’s validation flags, to override the default set of checks performed when validating a server certificate. By default, VALIDATE_ALL is used.

This function does not work as originally designed and is impossible to use correctly. See DtlsClientConnection:validation-flags for more information.

Added in version 2.48.

Deprecated since version 2.74: Do not attempt to ignore validation errors.

Parameters:

flags – the TlsCertificateFlags to use

Properties#

class DtlsClientConnection
props.accepted_cas: list[None]#

The type of the None singleton.

Added in version 2.48.

props.server_identity: SocketConnectable#

The type of the None singleton.

Added in version 2.48.

props.validation_flags: TlsCertificateFlags#

The type of the None singleton.

Added in version 2.48.

Deprecated since version 2.74: Do not attempt to ignore validation errors.