TlsClientConnectionImpl

data class TlsClientConnectionImpl(val gioTlsClientConnectionPointer: <Error class: unknown class><<Error class: unknown class>>) : TlsConnection, TlsClientConnection

The TlsClientConnectionImpl type represents a native instance of the TlsClientConnection interface.

Constructors

Link copied to clipboard
constructor(gioTlsClientConnectionPointer: <Error class: unknown class><<Error class: unknown class>>)

Creates a new instance of TlsClientConnection for the provided CPointer.

Properties

Link copied to clipboard
open val acceptedCas: <Error class: unknown class>

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.

Link copied to clipboard

The name of the TLS ciphersuite in use. See g_tls_connection_get_ciphersuite_name().

Link copied to clipboard

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().

Link copied to clipboard
val gioIoStreamPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
abstract val gioProxyPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gioTlsClientConnectionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gioTlsConnectionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The class@Gio.InputStream to read from.

Link copied to clipboard

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.

Link copied to clipboard

The application-layer protocol negotiated during the TLS handshake. See g_tls_connection_get_negotiated_protocol().

Link copied to clipboard

The class@Gio.OutputStream to write to.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

The TLS protocol version in use. See g_tls_connection_get_protocol_version().

Link copied to clipboard

The rehandshaking mode. See g_tls_connection_set_rehandshake_mode().

Link copied to clipboard

Whether or not proper TLS close notification is required. See g_tls_connection_set_require_close_notify().

Link copied to clipboard
open var useSsl3: Boolean

SSL 3.0 is no longer supported. See g_tls_client_connection_set_use_ssl3() for details.

Link copied to clipboard

Whether or not the system certificate database will be used to verify peer certificates. See g_tls_connection_set_use_system_certdb().

Link copied to clipboard

What steps to perform when validating a certificate received from a server. Server certificates that fail to validate in any of the ways indicated here will be rejected unless the application overrides the default via #GTlsConnection::accept-certificate.

Functions

Link copied to clipboard
open fun clearPending()

Clears the pending flag on @stream.

Link copied to clipboard
open fun close(cancellable: Cancellable? = null): <Error class: unknown class><Boolean>

Closes the stream, releasing resources related to it. This will also close the individual input and output streams, if they are not already closed.

Link copied to clipboard
open fun closeAsync(ioPriority: <Error class: unknown class>, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

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.

Link copied to clipboard
open fun closeFinish(result: AsyncResult): <Error class: unknown class><Boolean>

Closes a stream.

Link copied to clipboard
open fun connect(connection: IoStream, proxyAddress: ProxyAddress, cancellable: Cancellable? = null): <Error class: unknown class><IoStream>

Given @connection to communicate with a proxy (eg, a #GSocketConnection that is connected to the proxy server), this does the necessary handshake to connect to @proxy_address, and if required, wraps the #GIOStream to handle proxy payload.

Link copied to clipboard
open fun connectAsync(connection: IoStream, proxyAddress: ProxyAddress, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

Asynchronous version of g_proxy_connect().

Link copied to clipboard
open fun connectFinish(result: AsyncResult): <Error class: unknown class><IoStream>

See g_proxy_connect().

Link copied to clipboard

Possibly copies session state from one connection to another, for use in TLS session resumption. This is not normally needed, but may be used when the same session needs to be used between different endpoints, as is required by some protocols, such as FTP over TLS.

Link copied to clipboard

Used by #GTlsConnection implementations to emit the #GTlsConnection::accept-certificate signal.

Link copied to clipboard
open fun getAcceptedCas(): <Error class: unknown class>

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

Link copied to clipboard

Gets @conn's certificate, as set by g_tls_connection_set_certificate().

Link copied to clipboard

Gets @conn's expected server identity

Link copied to clipboard
open fun getUseSsl3(): Boolean

SSL 3.0 is no longer supported. See g_tls_client_connection_set_use_ssl3() for details.

Link copied to clipboard

Gets @conn's validation flags

Link copied to clipboard
open fun handshake(cancellable: Cancellable? = null): <Error class: unknown class><Boolean>

Attempts a TLS handshake on @conn.

Link copied to clipboard
open fun handshakeAsync(ioPriority: <Error class: unknown class>, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

Asynchronously performs a TLS handshake on @conn. See g_tls_connection_handshake() for more information.

Link copied to clipboard
open fun handshakeFinish(result: AsyncResult): <Error class: unknown class><Boolean>

Finish an asynchronous TLS handshake operation. See g_tls_connection_handshake() for more information.

Link copied to clipboard
open fun hasPending(): Boolean

Checks if a stream has pending actions.

Link copied to clipboard
open fun isClosed(): Boolean

Checks if a stream is closed.

Link copied to clipboard
fun onAcceptCertificate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (peerCert: TlsCertificate, errors: TlsCertificateFlags) -> Boolean): <Error class: unknown class>

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.

Link copied to clipboard
open fun setAdvertisedProtocols(protocols: List<String>? = null)

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.

Link copied to clipboard
open fun setCertificate(certificate: TlsCertificate)

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.

Link copied to clipboard
open fun setPending(): <Error class: unknown class><Boolean>

Sets @stream to have actions pending. If the pending flag is already set or @stream is closed, it will return false and set

Link copied to clipboard

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

Link copied to clipboard
open fun setUseSsl3(useSsl3: Boolean)

Since GLib 2.42.1, SSL 3.0 is no longer supported.

Link copied to clipboard

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

Link copied to clipboard
open fun spliceAsync(stream2: IoStream, flags: IoStreamSpliceFlags, ioPriority: <Error class: unknown class>, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

Asynchronously splice the output stream of @stream1 to the input stream of

Link copied to clipboard

Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return false if @proxy is implementing such a protocol. When false is returned, the caller should resolve the destination hostname first, and then pass a #GProxyAddress containing the stringified IP address to g_proxy_connect() or g_proxy_connect_async().