5 SSL_load_client_CA_file_ex, SSL_load_client_CA_file,
6 SSL_add_file_cert_subjects_to_stack,
7 SSL_add_dir_cert_subjects_to_stack,
8 SSL_add_store_cert_subjects_to_stack
9 - load certificate names
13 #include <openssl/ssl.h>
15 STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file,
18 STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
20 int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
22 int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
24 int SSL_add_store_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
29 SSL_load_client_CA_file_ex() reads certificates from I<file> and returns
30 a STACK_OF(X509_NAME) with the subject names found. The library context I<libctx>
31 and property query <propq> are used when fetching algorithms from providers.
33 SSL_load_client_CA_file() is similar to SSL_load_client_CA_file_ex()
34 but uses NULL for the library context I<libctx> and property query <propq>.
36 SSL_add_file_cert_subjects_to_stack() reads certificates from I<file>,
37 and adds their subject name to the already existing I<stack>.
39 SSL_add_dir_cert_subjects_to_stack() reads certificates from every
40 file in the directory I<dir>, and adds their subject name to the
41 already existing I<stack>.
43 SSL_add_store_cert_subjects_to_stack() loads certificates from the
44 I<store> URI, and adds their subject name to the already existing
49 SSL_load_client_CA_file() reads a file of PEM formatted certificates and
50 extracts the X509_NAMES of the certificates found. While the name suggests
51 the specific usage as support function for
52 L<SSL_CTX_set_client_CA_list(3)>,
53 it is not limited to CA certificates.
57 The following return values can occur:
63 The operation failed, check out the error stack for the reason.
65 =item Pointer to STACK_OF(X509_NAME)
67 Pointer to the subject names of the successfully read certificates.
73 Load names of CAs from file and use it as a client CA list:
76 STACK_OF(X509_NAME) *cert_names;
79 cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
80 if (cert_names != NULL)
81 SSL_CTX_set_client_CA_list(ctx, cert_names);
90 L<SSL_CTX_set_client_CA_list(3)>
94 SSL_load_client_CA_file_ex() and SSL_add_store_cert_subjects_to_stack()
95 were added in OpenSSL 3.0.
99 Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
101 Licensed under the Apache License 2.0 (the "License"). You may not use
102 this file except in compliance with the License. You can obtain a copy
103 in the file LICENSE in the source distribution or at
104 L<https://www.openssl.org/source/license.html>.