gi-gio-2.0.27: Gio bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Interfaces.DtlsClientConnection

Description

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

Since: 2.48

Synopsis

Exported types

class (GObject o, IsDescendantOf DtlsClientConnection o) => IsDtlsClientConnection o Source #

Type class for types which can be safely cast to DtlsClientConnection, for instance with toDtlsClientConnection.

Instances

Instances details
(GObject o, IsDescendantOf DtlsClientConnection o) => IsDtlsClientConnection o Source # 
Instance details

Defined in GI.Gio.Interfaces.DtlsClientConnection

toDtlsClientConnection :: (MonadIO m, IsDtlsClientConnection o) => o -> m DtlsClientConnection Source #

Cast to DtlsClientConnection, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getAcceptedCas

dtlsClientConnectionGetAcceptedCas Source #

Arguments

:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) 
=> a

conn: the DtlsClientConnection

-> m [ByteString]

Returns: the list of CA DNs. You should unref each element with byteArrayUnref and then the free the list with g_list_free().

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 Nothing.

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

Since: 2.48

getServerIdentity

dtlsClientConnectionGetServerIdentity Source #

Arguments

:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) 
=> a

conn: the DtlsClientConnection

-> m SocketConnectable

Returns: a SocketConnectable describing the expected server identity, or Nothing if the expected identity is not known.

Gets conn's expected server identity

Since: 2.48

getValidationFlags

dtlsClientConnectionGetValidationFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) 
=> a

conn: the DtlsClientConnection

-> m [TlsCertificateFlags]

Returns: the validation flags

Gets conn's validation flags

Since: 2.48

new

dtlsClientConnectionNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsDatagramBased a, IsSocketConnectable b) 
=> a

baseSocket: the DatagramBased to wrap

-> Maybe b

serverIdentity: the expected identity of the server

-> m DtlsClientConnection

Returns: the new DtlsClientConnection, or Nothing on error (Can throw GError)

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

Since: 2.48

setServerIdentity

dtlsClientConnectionSetServerIdentity Source #

Arguments

:: (HasCallStack, MonadIO m, IsDtlsClientConnection a, IsSocketConnectable b) 
=> a

conn: the DtlsClientConnection

-> b

identity: a SocketConnectable describing the expected server identity

-> m () 

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 TlsCertificateFlagsBadIdentity validation, if enabled.

Since: 2.48

setValidationFlags

dtlsClientConnectionSetValidationFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) 
=> a

conn: the DtlsClientConnection

-> [TlsCertificateFlags]

flags: the TlsCertificateFlags to use

-> m () 

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

Since: 2.48

Properties

acceptedCas

A list of the distinguished names of the Certificate Authorities that the server will accept client certificates signed by. If the server requests a client certificate during the handshake, then this property will be set after the handshake completes.

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

Since: 2.48

getDtlsClientConnectionAcceptedCas :: (MonadIO m, IsDtlsClientConnection o) => o -> m [Ptr ()] Source #

Get the value of the “accepted-cas” property. When overloading is enabled, this is equivalent to

get dtlsClientConnection #acceptedCas

serverIdentity

A SocketConnectable describing the identity of the server that is expected on the other end of the connection.

If the TlsCertificateFlagsBadIdentity flag is set in DtlsClientConnection:validation-flags, this object will be used to determine the expected identify of the remote end of the connection; if DtlsClientConnection:server-identity is not set, or does not match the identity presented by the server, then the TlsCertificateFlagsBadIdentity validation will fail.

In addition to its use in verifying the server certificate, this is also used to give a hint to the server about what certificate we expect, which is useful for servers that serve virtual hosts.

Since: 2.48

constructDtlsClientConnectionServerIdentity :: (IsDtlsClientConnection o, MonadIO m, IsSocketConnectable a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “server-identity” property. This is rarely needed directly, but it is used by new.

getDtlsClientConnectionServerIdentity :: (MonadIO m, IsDtlsClientConnection o) => o -> m SocketConnectable Source #

Get the value of the “server-identity” property. When overloading is enabled, this is equivalent to

get dtlsClientConnection #serverIdentity

setDtlsClientConnectionServerIdentity :: (MonadIO m, IsDtlsClientConnection o, IsSocketConnectable a) => o -> a -> m () Source #

Set the value of the “server-identity” property. When overloading is enabled, this is equivalent to

set dtlsClientConnection [ #serverIdentity := value ]

validationFlags

What steps to perform when validating a certificate received from a server. Server certificates that fail to validate in all of the ways indicated here will be rejected unless the application overrides the default via acceptCertificate.

Since: 2.48

constructDtlsClientConnectionValidationFlags :: (IsDtlsClientConnection o, MonadIO m) => [TlsCertificateFlags] -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “validation-flags” property. This is rarely needed directly, but it is used by new.

getDtlsClientConnectionValidationFlags :: (MonadIO m, IsDtlsClientConnection o) => o -> m [TlsCertificateFlags] Source #

Get the value of the “validation-flags” property. When overloading is enabled, this is equivalent to

get dtlsClientConnection #validationFlags

setDtlsClientConnectionValidationFlags :: (MonadIO m, IsDtlsClientConnection o) => o -> [TlsCertificateFlags] -> m () Source #

Set the value of the “validation-flags” property. When overloading is enabled, this is equivalent to

set dtlsClientConnection [ #validationFlags := value ]