5 SSL_load_client_CA_file,
6 SSL_add_file_cert_subjects_to_stack,
7 SSL_add_dir_cert_subjects_to_stack
8 - load certificate names
12 #include <openssl/ssl.h>
14 STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
16 int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
18 int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
23 SSL_load_client_CA_file() reads certificates from I<file> and returns
24 a STACK_OF(X509_NAME) with the subject names found.
26 SSL_add_file_cert_subjects_to_stack() reads certificates from I<file>,
27 and adds their subject name to the already existing I<stack>.
29 SSL_add_dir_cert_subjects_to_stack() reads certificates from every
30 file in the directory I<dir>, and adds their subject name to the
31 already existing I<stack>.
35 SSL_load_client_CA_file() reads a file of PEM formatted certificates and
36 extracts the X509_NAMES of the certificates found. While the name suggests
37 the specific usage as support function for
38 L<SSL_CTX_set_client_CA_list(3)>,
39 it is not limited to CA certificates.
43 The following return values can occur:
49 The operation failed, check out the error stack for the reason.
51 =item Pointer to STACK_OF(X509_NAME)
53 Pointer to the subject names of the successfully read certificates.
59 Load names of CAs from file and use it as a client CA list:
62 STACK_OF(X509_NAME) *cert_names;
65 cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
66 if (cert_names != NULL)
67 SSL_CTX_set_client_CA_list(ctx, cert_names);
75 L<SSL_CTX_set_client_CA_list(3)>
79 Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
81 Licensed under the OpenSSL license (the "License"). You may not use
82 this file except in compliance with the License. You can obtain a copy
83 in the file LICENSE in the source distribution or at
84 L<https://www.openssl.org/source/license.html>.