LIBRESSL-SSL_CTX_SET_CLIENT_CA_LIST(3)
π SSL_CTX_SET_CLIENT_CA_LIST(3) β the set-client-CA-list bestie era β¨
okay so this is one of those libssl / libcrypto man pages (manual name: SSL_CTX_SET_CLIENT_CA_LI(3), yes the title got cut off, we don't talk about it π) and it's all about the list of CAs a server sends to a client when it's like "hey babe, show me your certificate".
πΈ NAME πΈ
SSL_CTX_set_client_CA_list, SSL_set_client_CA_list, SSL_CTX_add_client_CA, SSL_add_client_CA β set the list of CAs sent to the client when requesting a client certificate β¨
π SYNOPSIS π
library βlibsslβ libcrypto
#include <openssl/ssl.h>
void
SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *list);
void
SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *list);
int
SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *cacert);
int
SSL_add_client_CA(SSL *ssl, X509 *cacert);
π¦ DESCRIPTION π¦
so here's the tea, fr fr π΅
SSL_CTX_set_client_CA_list()sets the list of CAs sent to the client when requesting a client certificate for ctx. like, the whole context's vibe check list πSSL_set_client_CA_list()sets the list of CAs sent to the client when requesting a client certificate for the chosen ssl, overriding the setting valid for ssl'sSSL_CTXobject. main character energy β it does NOT care what the context said β¨SSL_CTX_add_client_CA()adds the CA name extracted from cacert to the list of CAs sent to the client when requesting a client certificate for ctx πSSL_add_client_CA()adds the CA name extracted from cacert to the list of CAs sent to the client when requesting a client certificate for the chosen ssl, overriding the setting valid for ssl'sSSL_CTXobject π¦
when a TLS/SSL server requests a client certificate (see SSL_CTX_set_verify()), it sends a list of CAs for which it will accept certificates to the client. iykyk π
π not me reminding you: this list must explicitly be set usingSSL_CTX_set_client_CA_list()for ctx andSSL_set_client_CA_list()for the specific ssl. the list specified overrides the previous setting. and the CAs listed do not become trusted (the list only contains the names, not the complete certificates) β useSSL_CTX_load_verify_locations(3)to additionally load them for verification. no cap, that part matters π
if the list of acceptable CAs is compiled in a file, the SSL_load_client_CA_file(3) function can be used to help importing the necessary data. obsessed with a convenience function π«Ά
SSL_CTX_add_client_CA() and SSL_add_client_CA() can be used to add additional items to the list of client CAs. if no list was specified before using SSL_CTX_set_client_CA_list() or SSL_set_client_CA_list(), a new client CA list for ctx or ssl (as appropriate) is opened πβ¨
these functions are only useful for TLS/SSL servers π
β RETURN VALUES β
SSL_CTX_add_client_CA() and SSL_add_client_CA() have the following return values:
0β a failure while manipulating theSTACK_OF(X509_NAME)object occurred, or theX509_NAMEcould not be extracted from cacert. check the error stack to find out the reason π1β the operation succeeded π
π₯ EXAMPLES π₯
scan all certificates in CAfile and list them as acceptable CAs:
SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(CAfile));
one line, ate, periodt π
π SEE ALSO π
ssl(3), SSL_CTX_load_verify_locations(3), SSL_get_client_CA_list(3), SSL_load_client_CA_file(3), X509_NAME_new(3)
π HISTORY π
SSL_CTX_set_client_CA_list(), SSL_set_client_CA_list(), SSL_CTX_add_client_CA(), and SSL_add_client_CA() first appeared in SSLeay 0.8.0 and have been available since OpenBSD 2.4 π
okay that's the whole page bestie, go set your CA lists π β this icon was brought to you by Debian, dated June 8, 2025, answering to the name SSL_CTX_SET_CLIENT_CA_LIST(3) πβ¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2000, 2001, 2013 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms