📄 ssl_ctx_set_client_ca_list.pod
字号:
=pod=head1 NAMESSL_CTX_set_client_CA_list, SSL_set_client_CA_list, SSL_CTX_add_client_CA,SSL_add_client_CA - set list of CAs sent to the client when requesting aclient certificate=head1 SYNOPSIS #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);=head1 DESCRIPTIONSSL_CTX_set_client_CA_list() sets the B<list> of CAs sent to the client whenrequesting a client certificate for B<ctx>.SSL_set_client_CA_list() sets the B<list> of CAs sent to the client whenrequesting a client certificate for the chosen B<ssl>, overriding thesetting valid for B<ssl>'s SSL_CTX object.SSL_CTX_add_client_CA() adds the CA name extracted from B<cacert> to thelist of CAs sent to the client when requesting a client certificate forB<ctx>.SSL_add_client_CA() adds the CA name extracted from B<cacert> to thelist of CAs sent to the client when requesting a client certificate forthe chosen B<ssl>, overriding the setting valid for B<ssl>'s SSL_CTX object.=head1 NOTESWhen a TLS/SSL server requests a client certificate (seeB<SSL_CTX_set_verify_options()>), it sends a list of CAs, for whichit will accept certificates, to the client.This list must explicitly be set using SSL_CTX_set_client_CA_list() forB<ctx> and SSL_set_client_CA_list() for the specific B<ssl>. The listspecified overrides the previous setting. The CAs listed do not becometrusted (B<list> only contains the names, not the complete certificates); useL<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)> to additionally load them for verification.If the list of acceptable CAs is compiled in a file, theL<SSL_load_client_CA_file(3)|SSL_load_client_CA_file(3)>function can be used to help importing the necessary data.SSL_CTX_add_client_CA() and SSL_add_client_CA() can be used to add additionalitems the list of client CAs. If no list was specified before usingSSL_CTX_set_client_CA_list() or SSL_set_client_CA_list(), a new clientCA list for B<ctx> or B<ssl> (as appropriate) is opened.These functions are only useful for TLS/SSL servers.=head1 RETURN VALUESSSL_CTX_set_client_CA_list() and SSL_set_client_CA_list() do not returndiagnostic information.SSL_CTX_add_client_CA() and SSL_add_client_CA() have the following returnvalues:=over 4=item 1The operation succeeded.=item 0A failure while manipulating the STACK_OF(X509_NAME) object occurred orthe X509_NAME could not be extracted from B<cacert>. Check the error stackto find out the reason.=back=head1 EXAMPLESScan all certificates in B<CAfile> and list them as acceptable CAs: SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));=head1 SEE ALSOL<ssl(3)|ssl(3)>,L<SSL_get_client_CA_list(3)|SSL_get_client_CA_list(3)>,L<SSL_load_client_CA_file(3)|SSL_load_client_CA_file(3)>,L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -