SSL_set_retry_verify.pod 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. SSL_set_retry_verify - indicate that certificate verification should be retried
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. int SSL_set_retry_verify(SSL *ssl);
  7. =head1 DESCRIPTION
  8. SSL_set_retry_verify() should be called from the certificate verification
  9. callback on a client when the application wants to indicate that the handshake
  10. should be suspended and the control should be returned to the application.
  11. L<SSL_want_retry_verify(3)> will return 1 as a consequence until the handshake
  12. is resumed again by the application, retrying the verification step.
  13. Please refer to L<SSL_CTX_set_cert_verify_callback(3)> for further details.
  14. =head1 NOTES
  15. The effect of calling SSL_set_retry_verify() outside of the certificate
  16. verification callback on the client side is undefined.
  17. =head1 RETURN VALUES
  18. SSL_set_retry verify() returns 1 on success, 0 otherwise.
  19. =head1 EXAMPLES
  20. The following code snippet shows how to obtain the B<SSL> object associated
  21. with the B<X509_STORE_CTX> to call the SSL_set_retry_verify() function:
  22. int idx = SSL_get_ex_data_X509_STORE_CTX_idx();
  23. SSL *ssl;
  24. /* this should not happen but check anyway */
  25. if (idx < 0
  26. || (ssl = X509_STORE_CTX_get_ex_data(ctx, idx)) == NULL)
  27. return 0;
  28. if (/* we need to retry verification callback */)
  29. return SSL_set_retry_verify(ssl);
  30. /* do normal processing of the verification callback */
  31. =head1 SEE ALSO
  32. L<ssl(7)>, L<SSL_connect(3)>, L<SSL_CTX_set_cert_verify_callback(3)>,
  33. L<SSL_want_retry_verify(3)>
  34. =head1 HISTORY
  35. SSL_set_retry_verify() was added in OpenSSL 3.0.2 to replace backwards
  36. incompatible handling of a negative return value from the verification
  37. callback.
  38. =head1 COPYRIGHT
  39. Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
  40. Licensed under the Apache License 2.0 (the "License"). You may not use
  41. this file except in compliance with the License. You can obtain a copy
  42. in the file LICENSE in the source distribution or at
  43. L<https://www.openssl.org/source/license.html>.
  44. =cut