[#SSL_CTX_use_cert_and_key] = SSL_CTX_use_cert_and_key :mrdocs: Assign a certificate, private key, and optional chain onto an SSL context. == Synopsis Declared in `<openssl/ssl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int SSL_CTX_use_cert_and_key( xref:SSL_CTX.adoc[SSL_CTX]* ctx, xref:X509.adoc[X509]* x509, xref:EVP_PKEY.adoc[EVP_PKEY]* privatekey, xref:stack_st_X509.adoc[stack_st_X509]* chain, int override); ---- == Return Value 1 on success, or 0 on failure. == Parameters [cols="1,4"] |=== | Name| Description | *ctx* | SSL context that receives the credentials. | *x509* | End‐entity X.509 certificate (reference count incremented on success). | *privatekey* | Matching private key, or NULL to use `x509's` public key (e.g. hardware ENGINE). | *chain* | Optional intermediate certificate chain, or NULL. | *override* | If 0, set only when cert/key/chain were all previously unset; if non‐zero, always replace. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#