New manual page for a hardly known but important item :-)
[openssl.git] / doc / ssl / SSL_CTX_set_client_CA_list.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_CTX_set_client_CA_list, SSL_set_client_CA_list, SSL_CTX_add_client_CA,
6 SSL_add_client_CA - set list of CAs sent to the client when requesting a
7 client certificate
8
9 =head1 SYNOPSIS
10
11  #include <openssl/ssl.h>
12  
13  void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *list);
14  void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *list);
15  int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *cacert);
16  int SSL_add_client_CA(SSL *ssl, X509 *cacert);
17
18 =head1 DESCRIPTION
19
20 SSL_CTX_set_client_CA_list() sets the B<list> of CAs sent to the client when
21 requesting a client certificate for B<ctx>.
22
23 SSL_set_client_CA_list() sets the B<list> of CAs sent to the client when
24 requesting a client certificate for the chosen B<ssl>, overriding the
25 setting valid for B<ssl>'s SSL_CTX object.
26
27 SSL_CTX_add_client_CA() adds the CA name extracted from B<cacert> to the
28 list of CAs sent to the client when requesting a client certificate for
29 B<ctx>.
30
31 SSL_add_client_CA() adds the CA name extracted from B<cacert> to the
32 list of CAs sent to the client when requesting a client certificate for
33 the chosen B<ssl>, overriding the setting valid for B<ssl>'s SSL_CTX object.
34
35 =head1 NOTES
36
37 When a TLS/SSL server requests a client certificate (see
38 B<SSL_CTX_set_verify_options()>), it sends a list of CAs, for which
39 it will accept certificates, to the client. If no special list is provided,
40 the CAs available using the B<CAfile> option in
41 L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>
42 are sent.
43
44 This list can be explicitely set using the SSL_CTX_set_client_CA_list() for
45 B<ctx> and SSL_set_client_CA_list() for the specific B<ssl>. The list
46 specified overrides the previous setting. The CAs listed do not become
47 trusted (B<list> only contains the names, not the complete certificates); use
48 L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)> 
49 to additionally load them for verification.
50
51 SSL_CTX_add_client_CA() and SSL_add_client_CA() can be used to add additional
52 items the list of client CAs. If no list was specified before using
53 SSL_CTX_set_client_CA_list() or SSL_set_client_CA_list(), a new client
54 CA list for B<ctx> or B<ssl> (as appropriate) is opened. The CAs implicitly
55 specified using
56 L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>
57 are no longer used automatically.
58
59 These functions are only useful for TLS/SSL servers.
60
61 =head1 RETURN VALUES
62
63 SSL_CTX_set_client_CA_list() and SSL_set_client_CA_list() do not return
64 diagnostic information.
65
66 SSL_CTX_add_client_CA() and SSL_add_client_CA() have the following return
67 values:
68
69 =over 4
70
71 =item 1
72
73 The operation succeeded.
74
75 =item 0
76
77 A failure while manipulating the STACK_OF(X509_NAME) object occured or
78 the X509_NAME could not be extracted from B<cacert>. Check the error stack
79 to find out the reason.
80
81 =back
82
83 =head1 SEE ALSO
84
85 L<ssl(3)|ssl(3)>,
86 L<SSL_get_client_CA_list(3)|SSL_get_client_CA_list(3)>,
87 L<SSL_load_client_CA_file(3)|SSL_load_client_CA_file(3)>
88 L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>
89
90 =cut