nopoll_bool nopoll_ctx_set_certificate ( noPollCtx ctx,
const char *  serverName,
const char *  certificateFile,
const char *  privateKey,
const char *  optionalChainFile 

Allows to install a certificate to be used in general by all listener connections working under the provided context.

ctxThe context where the certificate will be installed.
serverNameThe optional server name to to limit the use of this certificate to the value provided here. Provide a NULL value to make the certificate provide to work under any server notified (Host: header) or via SNI (server name identification associated to the TLS transport).
certificateFileThe certificate file to be installed.
privateKeyThe private key file to use used.
optionalChainFileOptional chain file with additional material to complete the certificate definition.
nopoll_true if the certificate was installed otherwise nopoll_false. The function returns nopoll_false when ctx, certificateFile or privateKey are NULL.

References nopoll_ctx_find_certificate(), nopoll_false, nopoll_new, nopoll_realloc(), nopoll_return_val_if_fail, nopoll_strdup(), and nopoll_true.