TlsConnection
GTlsConnection
is the base TLS connection class type, which wraps a class@Gio.IOStream and provides TLS encryption on top of it. Its subclasses, iface@Gio.TlsClientConnection and iface@Gio.TlsServerConnection, implement client-side and server-side TLS, respectively.
For DTLS (Datagram TLS) support, see iface@Gio.DtlsConnection.
Skipped during bindings generation
parameter
data
: data: Out parameter is not supportedmethod
advertised-protocols
: Property has no gettermethod
base-io-stream
: Property has no getter nor settermethod
certificate
: Property TypeInfo of getter and setter do not match
Since
2.28
Constructors
Properties
The name of the TLS ciphersuite in use. See g_tls_connection_get_ciphersuite_name().
The certificate database to use when verifying this TLS connection. If no certificate database is set, then the default database will be used. See g_tls_backend_get_default_database().
The class@Gio.InputStream to read from.
A #GTlsInteraction object to be used when the connection or certificate database need to interact with the user. This will be used to prompt the user for passwords where necessary.
The application-layer protocol negotiated during the TLS handshake. See g_tls_connection_get_negotiated_protocol().
The class@Gio.OutputStream to write to.
The connection's peer's certificate, after the TLS handshake has completed or failed. Note in particular that this is not yet set during the emission of #GTlsConnection::accept-certificate.
The errors noticed while verifying #GTlsConnection:peer-certificate. Normally this should be 0, but it may not be if #GTlsClientConnection:validation-flags is not %G_TLS_CERTIFICATE_VALIDATE_ALL, or if #GTlsConnection::accept-certificate overrode the default behavior.
The TLS protocol version in use. See g_tls_connection_get_protocol_version().
The rehandshaking mode. See g_tls_connection_set_rehandshake_mode().
Whether or not proper TLS close notification is required. See g_tls_connection_set_require_close_notify().
Whether or not the system certificate database will be used to verify peer certificates. See g_tls_connection_set_use_system_certdb().
Functions
Clears the pending flag on @stream.
Closes the stream, releasing resources related to it. This will also close the individual input and output streams, if they are not already closed.
Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished @callback will be called. You can then call g_io_stream_close_finish() to get the result of the operation.
Closes a stream.
Emitted during the TLS handshake after the peer certificate has been received. You can examine @peer_cert's certification path by calling g_tls_certificate_get_issuer() on it.
Used by #GTlsConnection implementations to emit the #GTlsConnection::accept-certificate signal.
Gets @conn's certificate, as set by g_tls_connection_set_certificate().
Attempts a TLS handshake on @conn.
Asynchronously performs a TLS handshake on @conn. See g_tls_connection_handshake() for more information.
Finish an asynchronous TLS handshake operation. See g_tls_connection_handshake() for more information.
Checks if a stream has pending actions.
Sets the list of application-layer protocols to advertise that the caller is willing to speak on this connection. The Application-Layer Protocol Negotiation (ALPN) extension will be used to negotiate a compatible protocol with the peer; use g_tls_connection_get_negotiated_protocol() to find the negotiated protocol after the handshake. Specifying null for the the value of @protocols will disable ALPN negotiation.
This sets the certificate that @conn will present to its peer during the TLS handshake. For a #GTlsServerConnection, it is mandatory to set this, and that will normally be done at construct time.
Sets @stream to have actions pending. If the pending flag is already set or @stream is closed, it will return false and set
Asynchronously splice the output stream of @stream1 to the input stream of