cp_client_create(3)
| cp_socket(3) | cp_client | cp_socket(3) |
NAME
cp_client_create, cp_client_create_ssl - create a tcp client
SYNOPSIS
#include <cprops/client.h>
cp_client *cp_client_create(char *host, int
port);
cp_client *cp_client_create_ssl(char *host, int port,
char *CA_file, char *CA_directory, int
verification_mode);
DESCRIPTION
cp_client_create creates a cp_client structure to be used to connect to the given host on the given port. The call will fail if the requested host name could not be resolved, or if internal allocations fail.
cp_client_create_ssl does the same, but in addition
attempts to initialize an SSL_CTX object based on the given CA_file
or CA_directory - one of which must be specified. Certificates may be
read from a directory containing trusted certificate authority certificates
in PEM format using the CA_directory, or from a file specified by
CA_file. See SSL_CTX_load_verify_locations (3) for more on
certificate files.
verification_mode should be either SSL_VERIFY_NONE if a
connection should be established even if the server certificate cannot be
verified, or SSL_VERIFY_PEER to fail the connection on verification
failure.
Once a cp_client structure has been successfully created, cp_client_connect may be called to establish a connection.
cp_client object created with cp_client_create or cp_client_create_ssl should be finalized by calling cp_client_destroy.
RETURN VALUE
the newly created cp_client structure on success or NULL on failure.
SEE ALSO
SSL_CTX_load_verify_locations(3), cp_client_connect(3), cp_client_destroy(3)
| MARCH 2006 | libcprops |
