SocketClient.tlsValidationFlags

gio.types.TlsCertificateFlags tlsValidationFlags() @property

Get tlsValidationFlags property.

Returns

The TLS validation flags used when creating TLS connections. The

default value is [gio.types.TlsCertificateFlags.ValidateAll].

GLib guarantees that if certificate verification fails, at least one flag will be set, but it does not guarantee that all possible flags will be set. Accordingly, you may not safely decide to ignore any particular type of error. For example, it would be incorrect to mask [gio.types.TlsCertificateFlags.Expired] if you want to allow expired certificates, because this could potentially be the only error flag set even if other problems exist with the certificate. Therefore, there is no safe way to use this property. This is not a horrible problem, though, because you should not be attempting to ignore validation errors anyway. If you really must ignore TLS certificate errors, connect to the #GSocketClient::event signal, wait for it to be emitted with [gio.types.SocketClientEvent.TlsHandshaking], and use that to connect to #GTlsConnection::accept-certificate.

Deprecated

Do not attempt to ignore validation errors.
void tlsValidationFlags(gio.types.TlsCertificateFlags propval) @property

Set tlsValidationFlags property.

Parameters

propvalThe TLS validation flags used when creating TLS connections. The default value is [gio.types.TlsCertificateFlags.ValidateAll]. GLib guarantees that if certificate verification fails, at least one flag will be set, but it does not guarantee that all possible flags will be set. Accordingly, you may not safely decide to ignore any particular type of error. For example, it would be incorrect to mask [gio.types.TlsCertificateFlags.Expired] if you want to allow expired certificates, because this could potentially be the only error flag set even if other problems exist with the certificate. Therefore, there is no safe way to use this property. This is not a horrible problem, though, because you should not be attempting to ignore validation errors anyway. If you really must ignore TLS certificate errors, connect to the #GSocketClient::event signal, wait for it to be emitted with [gio.types.SocketClientEvent.TlsHandshaking], and use that to connect to #GTlsConnection::accept-certificate.

Deprecated

Do not attempt to ignore validation errors.