### Interface

# Gio TlsClientConnection

since: 2.28

#### Description [src]

    interface Gio.TlsClientConnection : Gio.TlsConnection

`GTlsClientConnection` is the client-side subclass of `GTlsConnection`, representing a client-side TLS connection.

Available since: 2.28

#### Prerequisite

In order to implement TlsClientConnection, your type must inherit from`GTlsConnection`.

#### Functions

###### g_tls_client_connection_new

Creates a new `GTlsClientConnection` wrapping `base_io_stream` (which must have pollable input and output streams) which is assumed to communicate with the server identified by `server_identity`.

since: 2.28

#### Instance methods

###### g_tls_client_connection_copy_session_state

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. `source` should have already completed a handshake and, since TLS 1.3, it should have been used to read data at least once. `conn` should not have completed a handshake.

since: 2.46

###### g_tls_client_connection_get_accepted_cas

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

since: 2.28

###### g_tls_client_connection_get_server_identity

Gets `conn`‘s expected server identity.

since: 2.28

###### g_tls_client_connection_get_use_ssl3

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

deprecated: 2.56 since: 2.28

###### g_tls_client_connection_get_validation_flags

Gets `conn`‘s validation flags.

deprecated: 2.72 since: 2.28

###### g_tls_client_connection_set_server_identity

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.

since: 2.28

###### g_tls_client_connection_set_use_ssl3

Since GLib 2.42.1, SSL 3.0 is no longer supported.

deprecated: 2.56 since: 2.28

###### g_tls_client_connection_set_validation_flags

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.

deprecated: 2.72 since: 2.28

#### Properties

###### Gio.TlsClientConnection:accepted-cas

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.

since: 2.28

###### Gio.TlsClientConnection:server-identity

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

since: 2.28

###### Gio.TlsClientConnection:use-ssl3

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

deprecated: 2.56 since: 2.28

###### Gio.TlsClientConnection:validation-flags

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

deprecated: 2.72 since: 2.28

#### Interface structure

    struct GioTlsClientConnectionInterface {
      GTypeInterface g_iface;
      void (* copy_session_state) (
        GTlsClientConnection* conn,
        GTlsClientConnection* source
      );

    }

Vtable for a `GTlsClientConnection` implementation.

###### Interface members

`g_iface` |
    GTypeInterface
| The parent interface.
`copy_session_state` |
    void (* copy_session_state) (
        GTlsClientConnection* conn,
        GTlsClientConnection* source
      )
| Copies session state from one `GTlsClientConnection` to another.

#### Virtual methods

###### Gio.TlsClientConnection.copy_session_state

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. `source` should have already completed a handshake and, since TLS 1.3, it should have been used to read data at least once. `conn` should not have completed a handshake.

since: 2.46