Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
DtlsClientConnection
is the client-side subclass of
DtlsConnection
, representing a client-side DTLS connection.
Since: 2.48
Synopsis
- newtype DtlsClientConnection = DtlsClientConnection (ManagedPtr DtlsClientConnection)
- noDtlsClientConnection :: Maybe DtlsClientConnection
- class (GObject o, IsDescendantOf DtlsClientConnection o) => IsDtlsClientConnection o
- toDtlsClientConnection :: (MonadIO m, IsDtlsClientConnection o) => o -> m DtlsClientConnection
- dtlsClientConnectionGetAcceptedCas :: (HasCallStack, MonadIO m, IsDtlsClientConnection a) => a -> m [ByteString]
- dtlsClientConnectionGetServerIdentity :: (HasCallStack, MonadIO m, IsDtlsClientConnection a) => a -> m SocketConnectable
- dtlsClientConnectionGetValidationFlags :: (HasCallStack, MonadIO m, IsDtlsClientConnection a) => a -> m [TlsCertificateFlags]
- dtlsClientConnectionNew :: (HasCallStack, MonadIO m, IsDatagramBased a, IsSocketConnectable b) => a -> Maybe b -> m DtlsClientConnection
- dtlsClientConnectionSetServerIdentity :: (HasCallStack, MonadIO m, IsDtlsClientConnection a, IsSocketConnectable b) => a -> b -> m ()
- dtlsClientConnectionSetValidationFlags :: (HasCallStack, MonadIO m, IsDtlsClientConnection a) => a -> [TlsCertificateFlags] -> m ()
- getDtlsClientConnectionAcceptedCas :: (MonadIO m, IsDtlsClientConnection o) => o -> m [Ptr ()]
- constructDtlsClientConnectionServerIdentity :: (IsDtlsClientConnection o, IsSocketConnectable a) => a -> IO (GValueConstruct o)
- getDtlsClientConnectionServerIdentity :: (MonadIO m, IsDtlsClientConnection o) => o -> m SocketConnectable
- setDtlsClientConnectionServerIdentity :: (MonadIO m, IsDtlsClientConnection o, IsSocketConnectable a) => o -> a -> m ()
- constructDtlsClientConnectionValidationFlags :: IsDtlsClientConnection o => [TlsCertificateFlags] -> IO (GValueConstruct o)
- getDtlsClientConnectionValidationFlags :: (MonadIO m, IsDtlsClientConnection o) => o -> m [TlsCertificateFlags]
- setDtlsClientConnectionValidationFlags :: (MonadIO m, IsDtlsClientConnection o) => o -> [TlsCertificateFlags] -> m ()
Exported types
newtype DtlsClientConnection Source #
Memory-managed wrapper type.
Instances
GObject DtlsClientConnection Source # | |
Defined in GI.Gio.Interfaces.DtlsClientConnection gobjectType :: IO GType # | |
HasParentTypes DtlsClientConnection Source # | |
Defined in GI.Gio.Interfaces.DtlsClientConnection | |
type ParentTypes DtlsClientConnection Source # | |
Defined in GI.Gio.Interfaces.DtlsClientConnection type ParentTypes DtlsClientConnection = DatagramBased ': (DtlsConnection ': (Object ': ([] :: [Type]))) |
noDtlsClientConnection :: Maybe DtlsClientConnection Source #
A convenience alias for Nothing
:: Maybe
DtlsClientConnection
.
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
(GObject o, IsDescendantOf DtlsClientConnection o) => IsDtlsClientConnection o Source # | |
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
getAcceptedCas
dtlsClientConnectionGetAcceptedCas Source #
:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) | |
=> a |
|
-> m [ByteString] | Returns: the list of
CA DNs. You should unref each element with |
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 #
:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) | |
=> a |
|
-> m SocketConnectable | Returns: a |
Gets conn
's expected server identity
Since: 2.48
getValidationFlags
dtlsClientConnectionGetValidationFlags Source #
:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) | |
=> a |
|
-> m [TlsCertificateFlags] | Returns: the validation flags |
Gets conn
's validation flags
Since: 2.48
new
dtlsClientConnectionNew Source #
:: (HasCallStack, MonadIO m, IsDatagramBased a, IsSocketConnectable b) | |
=> a |
|
-> Maybe b |
|
-> m DtlsClientConnection | Returns: the new
|
Creates a new DtlsClientConnection
wrapping baseSocket
which is
assumed to communicate with the server identified by serverIdentity
.
Since: 2.48
setServerIdentity
dtlsClientConnectionSetServerIdentity Source #
:: (HasCallStack, MonadIO m, IsDtlsClientConnection a, IsSocketConnectable b) | |
=> a |
|
-> b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsDtlsClientConnection a) | |
=> a |
|
-> [TlsCertificateFlags] |
|
-> 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, IsSocketConnectable a) => a -> IO (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 DtlsConnection
::accept-certificate
.
Since: 2.48
constructDtlsClientConnectionValidationFlags :: IsDtlsClientConnection o => [TlsCertificateFlags] -> IO (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 ]