2000-10-04 06:02:28 +08:00
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
2019-11-10 22:36:24 +08:00
|
|
|
SSL_load_client_CA_file,
|
|
|
|
SSL_add_file_cert_subjects_to_stack,
|
|
|
|
SSL_add_dir_cert_subjects_to_stack,
|
|
|
|
SSL_add_store_cert_subjects_to_stack
|
|
|
|
- load certificate names
|
2000-10-04 06:02:28 +08:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
|
|
|
|
STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
|
|
|
|
|
2019-11-10 22:36:24 +08:00
|
|
|
int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
|
|
|
|
const char *file)
|
|
|
|
int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
|
|
|
|
const char *dir)
|
|
|
|
int SSL_add_store_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
|
|
|
|
const char *store)
|
|
|
|
|
2000-10-04 06:02:28 +08:00
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2019-11-10 22:36:24 +08:00
|
|
|
SSL_load_client_CA_file() reads certificates from I<file> and returns
|
2000-10-04 06:02:28 +08:00
|
|
|
a STACK_OF(X509_NAME) with the subject names found.
|
|
|
|
|
2019-11-10 22:36:24 +08:00
|
|
|
SSL_add_file_cert_subjects_to_stack() reads certificates from I<file>,
|
|
|
|
and adds their subject name to the already existing I<stack>.
|
|
|
|
|
|
|
|
SSL_add_dir_cert_subjects_to_stack() reads certificates from every
|
|
|
|
file in the directory I<dir>, and adds their subject name to the
|
|
|
|
already existing I<stack>.
|
|
|
|
|
|
|
|
SSL_add_store_cert_subjects_to_stack() loads certificates from the
|
|
|
|
I<store> URI, and adds their subject name to the already existing
|
|
|
|
I<stack>.
|
|
|
|
|
2000-10-04 06:02:28 +08:00
|
|
|
=head1 NOTES
|
|
|
|
|
|
|
|
SSL_load_client_CA_file() reads a file of PEM formatted certificates and
|
|
|
|
extracts the X509_NAMES of the certificates found. While the name suggests
|
|
|
|
the specific usage as support function for
|
2015-08-18 03:21:33 +08:00
|
|
|
L<SSL_CTX_set_client_CA_list(3)>,
|
2000-10-04 06:02:28 +08:00
|
|
|
it is not limited to CA certificates.
|
|
|
|
|
|
|
|
=head1 RETURN VALUES
|
|
|
|
|
|
|
|
The following return values can occur:
|
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
|
|
|
=item NULL
|
|
|
|
|
|
|
|
The operation failed, check out the error stack for the reason.
|
|
|
|
|
|
|
|
=item Pointer to STACK_OF(X509_NAME)
|
|
|
|
|
|
|
|
Pointer to the subject names of the successfully read certificates.
|
|
|
|
|
|
|
|
=back
|
|
|
|
|
2019-02-26 13:11:10 +08:00
|
|
|
=head1 EXAMPLES
|
|
|
|
|
|
|
|
Load names of CAs from file and use it as a client CA list:
|
|
|
|
|
|
|
|
SSL_CTX *ctx;
|
|
|
|
STACK_OF(X509_NAME) *cert_names;
|
|
|
|
|
|
|
|
...
|
|
|
|
cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
|
|
|
|
if (cert_names != NULL)
|
|
|
|
SSL_CTX_set_client_CA_list(ctx, cert_names);
|
|
|
|
else
|
|
|
|
/* error */
|
|
|
|
...
|
|
|
|
|
2000-10-04 06:02:28 +08:00
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2016-11-11 16:33:09 +08:00
|
|
|
L<ssl(7)>,
|
2019-11-10 22:36:24 +08:00
|
|
|
L<ossl_store(7)>,
|
2015-08-18 03:21:33 +08:00
|
|
|
L<SSL_CTX_set_client_CA_list(3)>
|
2000-10-04 06:02:28 +08:00
|
|
|
|
2019-11-10 22:36:24 +08:00
|
|
|
=head1 HISTORY
|
|
|
|
|
|
|
|
SSL_add_store_cert_subjects_to_stack() was added in OpenSSL 3.0.
|
|
|
|
|
2016-05-18 23:44:05 +08:00
|
|
|
=head1 COPYRIGHT
|
|
|
|
|
2019-11-10 22:36:24 +08:00
|
|
|
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
2016-05-18 23:44:05 +08:00
|
|
|
|
2018-12-06 21:04:44 +08:00
|
|
|
Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 23:44:05 +08:00
|
|
|
this file except in compliance with the License. You can obtain a copy
|
|
|
|
in the file LICENSE in the source distribution or at
|
|
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
|
|
|
|
=cut
|