VortexConnection * vortex_tls_start_negotiation_sync ( VortexConnection connection,
const char *  serverName,
VortexStatus status,
char **  status_message 
)

Allows to start a TLS profile negotiation in a synchronous way (blocking the caller).

This actually uses vortex_tls_start_negotiation. Check out vortex_tls_start_negotiation documentation to know more about activating TLS profile.

If TLS profile is not supported the function returns the same connection received. To avoid problems you should use vortex_tls_is_enabled first.

Parameters:
connection The connection where the TLS profile negotiation will take place.
serverName The serverName optional value to request remote peer to act as server name.
status An optional reference to a VortexStatus variable so the caller could get a TLS activation status.
status_message An optional reference to get a textual diagnostic about TLS activation status.
Returns:
The new connection with TLS profile activated.
NOTE: About connection reference returned

The function always return a reference to a connection, even on TLS failures. Assuming this, it is required to call to vortex_connection_is_ok to check status and proceed as requried if the case an error was found. The same can be done using status or status_message parameters (checking state).

Because the function could fail before the TLS handshake can start or during it, the function returns the same connection if the failure was found before TLS started or a different connection reference (with the same data) if the error is found during the tuning. In both cases a valid reference (which is not the same as valid connection) is always returned (even if the connection is not working).