SSL_CTX_get0_param.pod 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_get0_param, SSL_get0_param, SSL_CTX_set1_param, SSL_set1_param -
  4. get and set verification parameters
  5. =head1 SYNOPSIS
  6. #include <openssl/ssl.h>
  7. X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx);
  8. X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl);
  9. int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
  10. int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
  11. =head1 DESCRIPTION
  12. SSL_CTX_get0_param() and SSL_get0_param() retrieve an internal pointer to
  13. the verification parameters for B<ctx> or B<ssl> respectively. The returned
  14. pointer must not be freed by the calling application.
  15. SSL_CTX_set1_param() and SSL_set1_param() set the verification parameters
  16. to B<vpm> for B<ctx> or B<ssl>.
  17. =head1 NOTES
  18. Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure
  19. using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies
  20. them to suit its needs: for example to add a hostname check.
  21. =head1 RETURN VALUES
  22. SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an
  23. B<X509_VERIFY_PARAM> structure.
  24. SSL_CTX_set1_param() and SSL_set1_param() return 1 for success and 0
  25. for failure.
  26. =head1 EXAMPLES
  27. Check hostname matches "www.foo.com" in peer certificate:
  28. X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
  29. X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
  30. =head1 SEE ALSO
  31. L<ssl(7)>,
  32. L<X509_VERIFY_PARAM_set_flags(3)>
  33. =head1 HISTORY
  34. These functions were added in OpenSSL 1.0.2.
  35. =head1 COPYRIGHT
  36. Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
  37. Licensed under the Apache License 2.0 (the "License"). You may not use
  38. this file except in compliance with the License. You can obtain a copy
  39. in the file LICENSE in the source distribution or at
  40. L<https://www.openssl.org/source/license.html>.
  41. =cut