SSL_CTX_SET1_...FY_CERT_STORE(3SSL)
okay so bestie, welcome to the SSL_CTX_SET1_...FY_CERT_STORE(3SSL) page β it's giving OpenSSL cert-store energy, and honestly? iconic. π
β¨
π NAME π
The whole squad is: SSL_CTX_set0_verify_cert_store, SSL_CTX_set1_verify_cert_store, SSL_CTX_set0_chain_cert_store, SSL_CTX_set1_chain_cert_store, SSL_set0_verify_cert_store, SSL_set1_verify_cert_store, SSL_set0_chain_cert_store, SSL_set1_chain_cert_store, SSL_CTX_get0_verify_cert_store, SSL_CTX_get0_chain_cert_store, SSL_get0_verify_cert_store, SSL_get0_chain_cert_store β and their job is literally to set certificate verification or chain store. π
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, X509_STORE *st);
int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *st);
int SSL_CTX_set0_chain_cert_store(SSL_CTX *ctx, X509_STORE *st);
int SSL_CTX_set1_chain_cert_store(SSL_CTX *ctx, X509_STORE *st);
int SSL_CTX_get0_verify_cert_store(SSL_CTX *ctx, X509_STORE **st);
int SSL_CTX_get0_chain_cert_store(SSL_CTX *ctx, X509_STORE **st);
int SSL_set0_verify_cert_store(SSL *ctx, X509_STORE *st);
int SSL_set1_verify_cert_store(SSL *ctx, X509_STORE *st);
int SSL_set0_chain_cert_store(SSL *ctx, X509_STORE *st);
int SSL_set1_chain_cert_store(SSL *ctx, X509_STORE *st);
int SSL_get0_verify_cert_store(SSL *ctx, X509_STORE **st);
int SSL_get0_chain_cert_store(SSL *ctx, X509_STORE **st);
π DESCRIPTION π
okay so lowkey here's the tea: βοΈ
SSL_CTX_set0_verify_cert_store()andSSL_CTX_set1_verify_cert_store()set the certificate store used for certificate verification tost. β¨SSL_CTX_set0_chain_cert_store()andSSL_CTX_set1_chain_cert_store()set the certificate store used for certificate chain building tost. πSSL_set0_verify_cert_store(),SSL_set1_verify_cert_store(),SSL_set0_chain_cert_store()andSSL_set1_chain_cert_store()are similar except they apply toSSLstructuressl. πSSL_CTX_get0_verify_chain_store(),SSL_get0_verify_chain_store(),SSL_CTX_get0_chain_cert_store()andSSL_get0_chain_cert_store()retrieve the objects previously set via the above calls. A pointer to the object (orNULLif no such object has been set) is written to*st. π«Ά- All these functions are implemented as macros. Those containing a
1increment the reference count of the supplied store so it must be freed at some point after the operation. Those containing a0do not increment reference counts and the supplied store MUST NOT be freed after the operation. π
π NOTES π
the way that these stores work is a whole saga, so listen up:
The stores pointers associated with an SSL_CTX structure are copied to any SSL structures when SSL_new() is called. As a result SSL structures will not be affected if the parent SSL_CTX store pointer is set to a new value. π§¬
The verification store is used to verify the certificate chain sent by the peer: that is an SSL/TLS client will use the verification store to verify the server's certificate chain and an SSL/TLS server will use it to verify any client certificate chain. π
The chain store is used to build the certificate chain. Details of the chain building and checking process are described in "Certification Path Building" in openssl-verification-options(1) and "Certification Path Validation" in openssl-verification-options(1). π
If the mode SSL_MODE_NO_AUTO_CHAIN is set or a certificate chain is configured already (for example using the functions such as SSL_CTX_add1_chain_cert(3) or SSL_CTX_add_extra_chain_cert(3)) then automatic chain building is disabled. π«
If the mode SSL_MODE_NO_AUTO_CHAIN is set then automatic chain building is disabled. (yes, again, periodt.) π
If the chain or the verification store is not set then the store associated with the parent SSL_CTX is used instead to retain compatibility with previous versions of OpenSSL. π«‘
β RETURN VALUES β
All these functions return 1 for success and 0 for failure. no cap. β¨
π SEE ALSO π
go read these next, bestie:
ssl(7)SSL_CTX_add_extra_chain_cert(3)SSL_CTX_set0_chain(3)SSL_CTX_set1_chain(3)SSL_CTX_add0_chain_cert(3)SSL_CTX_add1_chain_cert(3)SSL_set0_chain(3)SSL_set1_chain(3)SSL_add0_chain_cert(3)SSL_add1_chain_cert(3)SSL_CTX_build_cert_chain(3)SSL_build_cert_chain(3)
π°οΈ HISTORY π°οΈ
These functions were added in OpenSSL 1.0.2. vintage, but still slaying. πΆοΈ
π COPYRIGHT π
Copyright 2013-2022 The OpenSSL Project Authors. All Rights Reserved. π
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. πΈ
stay iconic, bestie β this was OpenSSL 4.0.3, dated 2026-09-2, for the SSL_CTX_SET1_...FY_CERT_STORE(3SSL) manual page. mwah! π«Άπ
β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms