### Function

# Gio TlsClientConnection new

since: 2.28

#### Declaration

    GIOStream*
    g_tls_client_connection_new (
      GIOStream* base_io_stream,
      GSocketConnectable* server_identity,
      GError** error
    )

#### Description

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

See the documentation for `GTlsConnection:base-io-stream` for restrictions on when application code can run operations on the `base_io_stream` after this function has returned.

Available since: 2.28

#### Parameters

`base_io_stream`

  Type: `GIOStream`

  The `GIOStream` to wrap.

  The data is owned by the caller of the function.

`server_identity`

  Type: `GSocketConnectable`

  The expected identity of the server.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the function if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `GTlsClientConnection`

The new `GTlsClientConnection`, or `NULL` on error.

The caller of the function takes ownership of the data, and is responsible for freeing it.