SSL_CTX_set1_verify_cert_store.pod 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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,
  7. SSL_CTX_get0_verify_cert_store, SSL_CTX_get0_chain_cert_store,
  8. SSL_get0_verify_cert_store, SSL_get0_chain_cert_store - set certificate
  9. verification or chain store
  10. =head1 SYNOPSIS
  11. #include <openssl/ssl.h>
  12. int SSL_CTX_set0_verify_cert_store(SSL_CTX *ctx, X509_STORE *st);
  13. int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *st);
  14. int SSL_CTX_set0_chain_cert_store(SSL_CTX *ctx, X509_STORE *st);
  15. int SSL_CTX_set1_chain_cert_store(SSL_CTX *ctx, X509_STORE *st);
  16. int SSL_CTX_get0_verify_cert_store(SSL_CTX *ctx, X509_STORE **st);
  17. int SSL_CTX_get0_chain_cert_store(SSL_CTX *ctx, X509_STORE **st);
  18. int SSL_set0_verify_cert_store(SSL *ctx, X509_STORE *st);
  19. int SSL_set1_verify_cert_store(SSL *ctx, X509_STORE *st);
  20. int SSL_set0_chain_cert_store(SSL *ctx, X509_STORE *st);
  21. int SSL_set1_chain_cert_store(SSL *ctx, X509_STORE *st);
  22. int SSL_get0_verify_cert_store(SSL *ctx, X509_STORE **st);
  23. int SSL_get0_chain_cert_store(SSL *ctx, X509_STORE **st);
  24. =head1 DESCRIPTION
  25. SSL_CTX_set0_verify_cert_store() and SSL_CTX_set1_verify_cert_store()
  26. set the certificate store used for certificate verification to B<st>.
  27. SSL_CTX_set0_chain_cert_store() and SSL_CTX_set1_chain_cert_store()
  28. set the certificate store used for certificate chain building to B<st>.
  29. SSL_set0_verify_cert_store(), SSL_set1_verify_cert_store(),
  30. SSL_set0_chain_cert_store() and SSL_set1_chain_cert_store() are similar
  31. except they apply to SSL structure B<ssl>.
  32. SSL_CTX_get0_verify_chain_store(), SSL_get0_verify_chain_store(),
  33. SSL_CTX_get0_chain_cert_store() and SSL_get0_chain_cert_store() retrieve the
  34. objects previously set via the above calls. A pointer to the object (or NULL if
  35. no such object has been set) is written to B<*st>.
  36. All these functions are implemented as macros. Those containing a B<1>
  37. increment the reference count of the supplied store so it must
  38. be freed at some point after the operation. Those containing a B<0> do
  39. not increment reference counts and the supplied store B<MUST NOT> be freed
  40. after the operation.
  41. =head1 NOTES
  42. The stores pointers associated with an SSL_CTX structure are copied to any SSL
  43. structures when SSL_new() is called. As a result SSL structures will not be
  44. affected if the parent SSL_CTX store pointer is set to a new value.
  45. The verification store is used to verify the certificate chain sent by the
  46. peer: that is an SSL/TLS client will use the verification store to verify
  47. the server's certificate chain and a SSL/TLS server will use it to verify
  48. any client certificate chain.
  49. The chain store is used to build the certificate chain.
  50. Details of the chain building and checking process are described in
  51. L<openssl-verification-options(1)/Certification Path Building> and
  52. L<openssl-verification-options(1)/Certification Path Validation>.
  53. If the mode B<SSL_MODE_NO_AUTO_CHAIN> is set or a certificate chain is
  54. configured already (for example using the functions such as
  55. L<SSL_CTX_add1_chain_cert(3)> or
  56. L<SSL_CTX_add_extra_chain_cert(3)>) then
  57. automatic chain building is disabled.
  58. If the mode B<SSL_MODE_NO_AUTO_CHAIN> is set then automatic chain building
  59. is disabled.
  60. If the chain or the verification store is not set then the store associated
  61. with the parent SSL_CTX is used instead to retain compatibility with previous
  62. versions of OpenSSL.
  63. =head1 RETURN VALUES
  64. All these functions return 1 for success and 0 for failure.
  65. =head1 SEE ALSO
  66. L<ssl(7)>,
  67. L<SSL_CTX_add_extra_chain_cert(3)>
  68. L<SSL_CTX_set0_chain(3)>
  69. L<SSL_CTX_set1_chain(3)>
  70. L<SSL_CTX_add0_chain_cert(3)>
  71. L<SSL_CTX_add1_chain_cert(3)>
  72. L<SSL_set0_chain(3)>
  73. L<SSL_set1_chain(3)>
  74. L<SSL_add0_chain_cert(3)>
  75. L<SSL_add1_chain_cert(3)>
  76. L<SSL_CTX_build_cert_chain(3)>
  77. L<SSL_build_cert_chain(3)>
  78. =head1 HISTORY
  79. These functions were added in OpenSSL 1.0.2.
  80. =head1 COPYRIGHT
  81. Copyright 2013-2022 The OpenSSL Project Authors. All Rights Reserved.
  82. Licensed under the Apache License 2.0 (the "License"). You may not use
  83. this file except in compliance with the License. You can obtain a copy
  84. in the file LICENSE in the source distribution or at
  85. L<https://www.openssl.org/source/license.html>.
  86. =cut