TlsConnection from SocketClient with TLS enabled?

I don’t understand what exactly this method does:

If create TLS session, how can I get / cast TlsConnection from SocketClient
where it option set as true

Sorry, I forgot to update GIO version to 2.28, now everything work as documented:

Note that since GSocketClient must return a GSocketConnection, but GTlsClientConnection is not a GSocketConnection, this actually wraps the resulting GTlsClientConnection in a GTcpWrapperConnection when returning it. You can use g_tcp_wrapper_connection_get_base_io_stream() on the return value to extract the GTlsClientConnection.

But GLib 2.28 was released in 2011. You were using something even older than that?

This forum is for discussing recent software versions. Please make sure you’ve updated to 2.82 or something at least close to that.

2.28 is min requirement by documentation, I have 2.70

Anyway, to answer my question, seems there is no way to cast, but create new TlsClientConnection for existing IOStream to interact it as TlsClientConnection.