SSL_CTX_set0_CA_list.pod 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. =pod
  2. =head1 NAME
  3. SSL_set0_CA_list, SSL_CTX_set0_CA_list, SSL_get0_CA_list,
  4. SSL_CTX_get0_CA_list, SSL_add1_CA_list, SSL_CTX_add1_CA_list,
  5. SSL_get0_peer_CA_list - get or set CA list
  6. =head1 SYNOPSIS
  7. #include <openssl/ssl.h>
  8. void SSL_CTX_set0_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
  9. void SSL_set0_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
  10. const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const SSL_CTX *ctx);
  11. const STACK_OF(X509_NAME) *SSL_get0_CA_list(const SSL *s);
  12. int SSL_CTX_add1_CA_list(SSL_CTX *ctx, const X509 *x);
  13. int SSL_add1_CA_list(SSL *ssl, const X509 *x);
  14. const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const SSL *s);
  15. =head1 DESCRIPTION
  16. SSL_CTX_set0_CA_list() sets the list of CAs to be sent to the peer to
  17. B<name_list>. Ownership of B<name_list> is transferred to B<ctx> and
  18. it should not be freed by the caller.
  19. SSL_set0_CA_list() sets the list of CAs to be sent to the peer to B<name_list>
  20. overriding any list set in the parent B<SSL_CTX> of B<s>. Ownership of
  21. B<name_list> is transferred to B<s> and it should not be freed by the caller.
  22. SSL_CTX_get0_CA_list() retrieves any previously set list of CAs set for
  23. B<ctx>.
  24. SSL_CTX_get0_CA_list() retrieves any previously set list of CAs set for
  25. B<s> or if none are set the list from the parent B<SSL_CTX> is retrieved.
  26. SSL_CTX_add1_CA_list() appends the CA subject name extracted from B<x> to the
  27. list of CAs sent to peer for B<ctx>.
  28. SSL_add1_CA_list() appends the CA subject name extracted from B<x> to the
  29. list of CAs sent to the peer for B<s>, overriding the setting in the parent
  30. B<SSL_CTX>.
  31. SSL_get0_peer_CA_list() retrieves the list of CA names (if any) the peer
  32. has sent.
  33. =head1 NOTES
  34. These functions are generalised versions of the client authentication
  35. CA list functions such as L<SSL_CTX_set_client_CA_list(3)>.
  36. For TLS versions before 1.3 the list of CA names is only sent from the server
  37. to client when requesting a client certificate. So any list of CA names set
  38. is never sent from client to server and the list of CA names retrieved by
  39. SSL_get0_peer_CA_list() is always B<NULL>.
  40. For TLS 1.3 the list of CA names is sent using the B<certificate_authorities>
  41. extension and will be sent by a client (in the ClientHello message) or by
  42. a server (when requesting a certificate).
  43. =head1 RETURN VALUES
  44. SSL_CTX_set0_CA_list() and SSL_set0_CA_list() do not return a value.
  45. SSL_CTX_get0_CA_list() and SSL_get0_CA_list() return a stack of CA names
  46. or B<NULL> is no CA names are set.
  47. SSL_CTX_add1_CA_list() and SSL_add1_CA_list() return 1 for success and 0
  48. for failure.
  49. SSL_get0_peer_CA_list() returns a stack of CA names sent by the peer or
  50. B<NULL> or an empty stack if no list was sent.
  51. =head1 SEE ALSO
  52. L<ssl(7)>,
  53. L<SSL_CTX_set_client_CA_list(3)>,
  54. L<SSL_get_client_CA_list(3)>,
  55. L<SSL_load_client_CA_file(3)>,
  56. L<SSL_CTX_load_verify_locations(3)>
  57. =head1 COPYRIGHT
  58. Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
  59. Licensed under the OpenSSL license (the "License"). You may not use
  60. this file except in compliance with the License. You can obtain a copy
  61. in the file LICENSE in the source distribution or at
  62. L<https://www.openssl.org/source/license.html>.
  63. =cut