tls_connect_fds3
Instruct a tls client to establish a connection
Part of tls_connect(3).
Usage
int
int
int
int
int
Overview
After creating a TLS client context with tls_client(3) and configuring it with tls_configure(3), a client connection is initiated by calling tls_connect(). This function will create a new socket, connect to the specified host and port, and then establish a secure connection. The port may be numeric or a service name. If it is NULL, then a host of the format "hostname:port" is permitted. The name to use for verification is inferred from the host value.
The tls_connect_servername() function has the same behaviour, however the name to use for verification is explicitly provided, for the case where the TLS server name differs from the DNS name.
An already existing socket can be upgraded to a secure connection by calling tls_connect_socket().
Alternatively, a secure connection can be established over a pair of existing file descriptors by calling tls_connect_fds().
Calling tls_connect_cbs() allows read and write callback functions to handle data transfers. The specified cb_arg parameter is passed back to the functions, and can contain a pointer to any caller-specified data.
Return values
These functions return 0 on success or -1 on error.