SSL_CTX_set_cert_store.pod 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_set_cert_store, SSL_CTX_set1_cert_store, SSL_CTX_get_cert_store - manipulate X509 certificate verification storage
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store);
  7. void SSL_CTX_set1_cert_store(SSL_CTX *ctx, X509_STORE *store);
  8. X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx);
  9. =head1 DESCRIPTION
  10. SSL_CTX_set_cert_store() sets/replaces the certificate verification storage
  11. of B<ctx> to/with B<store>. If another X509_STORE object is currently
  12. set in B<ctx>, it will be X509_STORE_free()ed.
  13. SSL_CTX_set1_cert_store() sets/replaces the certificate verification storage
  14. of B<ctx> to/with B<store>. The B<store>'s reference count is incremented.
  15. If another X509_STORE object is currently set in B<ctx>, it will be X509_STORE_free()ed.
  16. SSL_CTX_get_cert_store() returns a pointer to the current certificate
  17. verification storage.
  18. =head1 NOTES
  19. In order to verify the certificates presented by the peer, trusted CA
  20. certificates must be accessed. These CA certificates are made available
  21. via lookup methods, handled inside the X509_STORE. From the X509_STORE
  22. the X509_STORE_CTX used when verifying certificates is created.
  23. Typically the trusted certificate store is handled indirectly via using
  24. L<SSL_CTX_load_verify_locations(3)>.
  25. Using the SSL_CTX_set_cert_store() and SSL_CTX_get_cert_store() functions
  26. it is possible to manipulate the X509_STORE object beyond the
  27. L<SSL_CTX_load_verify_locations(3)>
  28. call.
  29. Currently no detailed documentation on how to use the X509_STORE
  30. object is available. Not all members of the X509_STORE are used when
  31. the verification takes place. So will e.g. the verify_callback() be
  32. overridden with the verify_callback() set via the
  33. L<SSL_CTX_set_verify(3)> family of functions.
  34. This document must therefore be updated when documentation about the
  35. X509_STORE object and its handling becomes available.
  36. SSL_CTX_set_cert_store() does not increment the B<store>'s reference
  37. count, so it should not be used to assign an X509_STORE that is owned
  38. by another SSL_CTX.
  39. To share X509_STOREs between two SSL_CTXs, use SSL_CTX_get_cert_store()
  40. to get the X509_STORE from the first SSL_CTX, and then use
  41. SSL_CTX_set1_cert_store() to assign to the second SSL_CTX and
  42. increment the reference count of the X509_STORE.
  43. =head1 RESTRICTIONS
  44. The X509_STORE structure used by an SSL_CTX is used for verifying peer
  45. certificates and building certificate chains, it is also shared by
  46. every child SSL structure. Applications wanting finer control can use
  47. functions such as SSL_CTX_set1_verify_cert_store() instead.
  48. =head1 RETURN VALUES
  49. SSL_CTX_set_cert_store() does not return diagnostic output.
  50. SSL_CTX_set1_cert_store() does not return diagnostic output.
  51. SSL_CTX_get_cert_store() returns the current setting.
  52. =head1 SEE ALSO
  53. L<ssl(7)>,
  54. L<SSL_CTX_load_verify_locations(3)>,
  55. L<SSL_CTX_set_verify(3)>
  56. =head1 COPYRIGHT
  57. Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
  58. Licensed under the OpenSSL license (the "License"). You may not use
  59. this file except in compliance with the License. You can obtain a copy
  60. in the file LICENSE in the source distribution or at
  61. L<https://www.openssl.org/source/license.html>.
  62. =cut