void vortex_connection_set_auto_tls gboolean  enabled,
gboolean  allow_tls_failures,
gchar *  serverName

Allows to activate TLS profile automatic negotiation for every connection created.

Once a user application is developed using Vortex Library it could be interesting to instruct Vortex Library to automatically negotiate the TLS profile for every connection created. This will make that every call to vortex_connection_new will return not only an instance already connected but also with the TLS profile already activated.

This allows to take advantage about source code developed to create and wait for a VortexConnection to be created rather than having two steps at the user space: first create the connection and the TLS-ficate it with vortex_tls_start_negociation.

The function allows to specify the optional serverName value to be used when vortex_tls_start_negociation is called. The values set on this function will make effect to all connections created.

Once a connection is created, the TLS profile negotiation could fail. This is because the remote peer could be not accepting TLS request, or the serverName request is not accepted or any other issue.

This could be a security problem because there is no difference from using a VortexConnection with TLS profile activated from other one without it. This could cause user application to start using a connection that is successfully connected but the TLS profile have actually failed, sending and receiving text in plain mode.

The parameter allow_tls_failures allows to configure what is the default action is to be taken on TLS failures. By default, if TLS profile negotiation fails, the connection is closed, returning that the TLS profile have failed.

Using a TRUE value allows to still keep on working even if the TLS profile negotiation have failed.

By default, Vortex Library have auto TLS feature disabled.

NOTE: If current Vortex Library doesn't have built-in support for TLS profile, automatic TLS profile negotiation will always fails. This means that setting allow_tls_failures to FALSE will cause Vortex Library client peer to always fail to create new connections.

enabled TRUE to activate the automatic TLS profile negotiation for every connection created, FALSE to disable it.
allow_tls_failures Configure how to handle errors produced while activating automatic TLS negotiation.
serverName The server name value to be passed in to vortex_tls_start_negociation. If the received is not NULL the function will perform a local copy