SSL_CTX_set1_verify_cert_store.pod 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_set0_verify_cert_store, SSL_CTX_set1_verify_cert_store,
  4. SSL_CTX_set0_chain_cert_store, SSL_CTX_set1_chain_cert_store,
  5. SSL_set0_verify_cert_store, SSL_set1_verify_cert_store,
  6. SSL_set0_chain_cert_store, SSL_set1_chain_cert_store - set certificate
  7. verification or chain store
  8. =head1 SYNOPSIS
  9. #include <openssl/ssl.h>
  10. int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, X509_STORE *st);
  11. int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *st);
  12. int SSL_CTX_set0_chain_cert_store(SSL_CTX *ctx, X509_STORE *st);
  13. int SSL_CTX_set1_chain_cert_store(SSL_CTX *ctx, X509_STORE *st);
  14. int SSL_set0_verify_cert_store(SSL *ctx, X509_STORE *st);
  15. int SSL_set1_verify_cert_store(SSL *ctx, X509_STORE *st);
  16. int SSL_set0_chain_cert_store(SSL *ctx, X509_STORE *st);
  17. int SSL_set1_chain_cert_store(SSL *ctx, X509_STORE *st);
  18. =head1 DESCRIPTION
  19. SSL_CTX_set0_verify_cert_store() and SSL_CTX_set1_verify_cert_store()
  20. set the certificate store used for certificate verification to B<st>.
  21. SSL_CTX_set0_chain_cert_store() and SSL_CTX_set1_chain_cert_store()
  22. set the certificate store used for certificate chain building to B<st>.
  23. SSL_set0_verify_cert_store(), SSL_set1_verify_cert_store(),
  24. SSL_set0_chain_cert_store() and SSL_set1_chain_cert_store() are similar
  25. except they apply to SSL structure B<ssl>.
  26. All these functions are implemented as macros. Those containing a B<1>
  27. increment the reference count of the supplied store so it must
  28. be freed at some point after the operation. Those containing a B<0> do
  29. not increment reference counts and the supplied store B<MUST NOT> be freed
  30. after the operation.
  31. =head1 NOTES
  32. The stores pointers associated with an SSL_CTX structure are copied to any SSL
  33. structures when SSL_new() is called. As a result SSL structures will not be
  34. affected if the parent SSL_CTX store pointer is set to a new value.
  35. The verification store is used to verify the certificate chain sent by the
  36. peer: that is an SSL/TLS client will use the verification store to verify
  37. the server's certificate chain and a SSL/TLS server will use it to verify
  38. any client certificate chain.
  39. The chain store is used to build the certificate chain.
  40. If the mode B<SSL_MODE_NO_AUTO_CHAIN> is set or a certificate chain is
  41. configured already (for example using the functions such as
  42. L<SSL_CTX_add1_chain_cert(3)|SSL_CTX_add1_chain_cert(3)> or
  43. L<SSL_CTX_add_extra_chain_cert(3)|SSL_CTX_add_extra_chain_cert(3)>) then
  44. automatic chain building is disabled.
  45. If the mode B<SSL_MODE_NO_AUTO_CHAIN> is set then automatic chain building
  46. is disabled.
  47. If the chain or the verification store is not set then the store associated
  48. with the parent SSL_CTX is used instead to retain compatibility with previous
  49. versions of OpenSSL.
  50. =head1 RETURN VALUES
  51. All these functions return 1 for success and 0 for failure.
  52. =head1 SEE ALSO
  53. L<SSL_CTX_add_extra_chain_cert(3)|SSL_CTX_add_extra_chain_cert(3)>
  54. L<SSL_CTX_set0_chain(3)|SSL_CTX_set0_chain(3)>
  55. L<SSL_CTX_set1_chain(3)|SSL_CTX_set1_chain(3)>
  56. L<SSL_CTX_add0_chain_cert(3)|SSL_CTX_add0_chain_cert(3)>
  57. L<SSL_CTX_add1_chain_cert(3)|SSL_CTX_add1_chain_cert(3)>
  58. L<SSL_set0_chain(3)|SSL_set0_chain(3)>
  59. L<SSL_set1_chain(3)|SSL_set1_chain(3)>
  60. L<SSL_add0_chain_cert(3)|SSL_add0_chain_cert(3)>
  61. L<SSL_add1_chain_cert(3)|SSL_add1_chain_cert(3)>
  62. L<SSL_CTX_build_cert_chain(3)|SSL_CTX_build_cert_chain(3)>
  63. L<SSL_build_cert_chain(3)|SSL_build_cert_chain(3)>
  64. =head1 HISTORY
  65. These functions were first added to OpenSSL 1.0.2.
  66. =cut