xref: /freebsd/crypto/openssl/doc/man3/SSL_load_client_CA_file.pod (revision 6966ac055c3b7a39266fb982493330df7a097997)
1=pod
2
3=head1 NAME
4
5SSL_load_client_CA_file - load certificate names from file
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
12
13=head1 DESCRIPTION
14
15SSL_load_client_CA_file() reads certificates from B<file> and returns
16a STACK_OF(X509_NAME) with the subject names found.
17
18=head1 NOTES
19
20SSL_load_client_CA_file() reads a file of PEM formatted certificates and
21extracts the X509_NAMES of the certificates found. While the name suggests
22the specific usage as support function for
23L<SSL_CTX_set_client_CA_list(3)>,
24it is not limited to CA certificates.
25
26=head1 RETURN VALUES
27
28The following return values can occur:
29
30=over 4
31
32=item NULL
33
34The operation failed, check out the error stack for the reason.
35
36=item Pointer to STACK_OF(X509_NAME)
37
38Pointer to the subject names of the successfully read certificates.
39
40=back
41
42=head1 EXAMPLES
43
44Load names of CAs from file and use it as a client CA list:
45
46 SSL_CTX *ctx;
47 STACK_OF(X509_NAME) *cert_names;
48
49 ...
50 cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
51 if (cert_names != NULL)
52     SSL_CTX_set_client_CA_list(ctx, cert_names);
53 else
54     /* error */
55 ...
56
57=head1 SEE ALSO
58
59L<ssl(7)>,
60L<SSL_CTX_set_client_CA_list(3)>
61
62=head1 COPYRIGHT
63
64Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
65
66Licensed under the OpenSSL license (the "License").  You may not use
67this file except in compliance with the License.  You can obtain a copy
68in the file LICENSE in the source distribution or at
69L<https://www.openssl.org/source/license.html>.
70
71=cut
72