SSL_CTX_add_extra_chain_cert.pod 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_add_extra_chain_cert,
  4. SSL_CTX_get_extra_chain_certs,
  5. SSL_CTX_get_extra_chain_certs_only,
  6. SSL_CTX_clear_extra_chain_certs
  7. - add, get or clear extra chain certificates
  8. =head1 SYNOPSIS
  9. #include <openssl/ssl.h>
  10. long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509);
  11. long SSL_CTX_get_extra_chain_certs(SSL_CTX *ctx, STACK_OF(X509) **sk);
  12. long SSL_CTX_get_extra_chain_certs_only(SSL_CTX *ctx, STACK_OF(X509) **sk);
  13. long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx);
  14. =head1 DESCRIPTION
  15. SSL_CTX_add_extra_chain_cert() adds the certificate B<x509> to the extra chain
  16. certificates associated with B<ctx>. Several certificates can be added one
  17. after another.
  18. SSL_CTX_get_extra_chain_certs() retrieves the extra chain certificates
  19. associated with B<ctx>, or the chain associated with the current certificate
  20. of B<ctx> if the extra chain is empty.
  21. The returned stack should not be freed by the caller.
  22. SSL_CTX_get_extra_chain_certs_only() retrieves the extra chain certificates
  23. associated with B<ctx>.
  24. The returned stack should not be freed by the caller.
  25. SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates
  26. associated with B<ctx>.
  27. These functions are implemented as macros.
  28. =head1 NOTES
  29. When sending a certificate chain, extra chain certificates are sent in order
  30. following the end entity certificate.
  31. If no chain is specified, the library will try to complete the chain from the
  32. available CA certificates in the trusted CA storage, see
  33. L<SSL_CTX_load_verify_locations(3)>.
  34. The B<x509> certificate provided to SSL_CTX_add_extra_chain_cert() will be
  35. freed by the library when the B<SSL_CTX> is destroyed. An application
  36. B<should not> free the B<x509> object.
  37. =head1 RESTRICTIONS
  38. Only one set of extra chain certificates can be specified per SSL_CTX
  39. structure. Different chains for different certificates (for example if both
  40. RSA and DSA certificates are specified by the same server) or different SSL
  41. structures with the same parent SSL_CTX cannot be specified using this
  42. function. For more flexibility functions such as SSL_add1_chain_cert() should
  43. be used instead.
  44. =head1 RETURN VALUES
  45. SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return
  46. 1 on success and 0 for failure. Check out the error stack to find out the
  47. reason for failure.
  48. =head1 SEE ALSO
  49. L<ssl(7)>,
  50. L<SSL_CTX_use_certificate(3)>,
  51. L<SSL_CTX_set_client_cert_cb(3)>,
  52. L<SSL_CTX_load_verify_locations(3)>
  53. L<SSL_CTX_set0_chain(3)>
  54. L<SSL_CTX_set1_chain(3)>
  55. L<SSL_CTX_add0_chain_cert(3)>
  56. L<SSL_CTX_add1_chain_cert(3)>
  57. L<SSL_set0_chain(3)>
  58. L<SSL_set1_chain(3)>
  59. L<SSL_add0_chain_cert(3)>
  60. L<SSL_add1_chain_cert(3)>
  61. L<SSL_CTX_build_cert_chain(3)>
  62. L<SSL_build_cert_chain(3)>
  63. =head1 COPYRIGHT
  64. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
  65. Licensed under the Apache License 2.0 (the "License"). You may not use
  66. this file except in compliance with the License. You can obtain a copy
  67. in the file LICENSE in the source distribution or at
  68. L<https://www.openssl.org/source/license.html>.
  69. =cut