SSL_get_verify_result.pod 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. =pod
  2. =head1 NAME
  3. SSL_get_verify_result - get result of peer certificate verification
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. long SSL_get_verify_result(const SSL *ssl);
  7. =head1 DESCRIPTION
  8. SSL_get_verify_result() returns the result of the verification of the
  9. X509 certificate presented by the peer, if any.
  10. =head1 NOTES
  11. SSL_get_verify_result() can only return one error code while the verification
  12. of a certificate can fail because of many reasons at the same time. Only
  13. the last verification error that occurred during the processing is available
  14. from SSL_get_verify_result().
  15. Sometimes there can be a sequence of errors leading to the verification
  16. failure as reported by SSL_get_verify_result().
  17. To get the errors, it is necessary to setup a verify callback via
  18. L<SSL_CTX_set_verify(3)> or L<SSL_set_verify(3)> and retrieve the errors
  19. from the error stack there, because once L<SSL_connect(3)> returns,
  20. these errors may no longer be available.
  21. The verification result is part of the established session and is restored
  22. when a session is reused.
  23. =head1 BUGS
  24. If no peer certificate was presented, the returned result code is
  25. X509_V_OK. This is because no verification error occurred, it does however
  26. not indicate success. SSL_get_verify_result() is only useful in connection
  27. with L<SSL_get_peer_certificate(3)>.
  28. =head1 RETURN VALUES
  29. The following return values can currently occur:
  30. =over 4
  31. =item X509_V_OK
  32. The verification succeeded or no peer certificate was presented.
  33. =item Any other value
  34. Documented in L<openssl-verify(1)>.
  35. =back
  36. =head1 SEE ALSO
  37. L<ssl(7)>, L<SSL_set_verify_result(3)>,
  38. L<SSL_get_peer_certificate(3)>,
  39. L<openssl-verify(1)>
  40. =head1 COPYRIGHT
  41. Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
  42. Licensed under the Apache License 2.0 (the "License"). You may not use
  43. this file except in compliance with the License. You can obtain a copy
  44. in the file LICENSE in the source distribution or at
  45. L<https://www.openssl.org/source/license.html>.
  46. =cut