2
0

SSL_set_blocking_mode.pod 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. =pod
  2. =head1 NAME
  3. SSL_set_blocking_mode, SSL_get_blocking_mode - configure blocking mode for a
  4. QUIC SSL object
  5. =head1 SYNOPSIS
  6. #include <openssl/ssl.h>
  7. int SSL_set_blocking_mode(SSL *s, int blocking);
  8. int SSL_get_blocking_mode(SSL *s);
  9. =head1 DESCRIPTION
  10. SSL_set_blocking_mode() can be used to enable or disable blocking mode on a QUIC
  11. connection SSL object. By default, blocking is enabled, unless the SSL object is
  12. configured to use an underlying read or write BIO which cannot provide a poll
  13. descriptor (see L<BIO_get_rpoll_descriptor(3)>), as blocking mode cannot be
  14. supported in this case.
  15. To enable blocking mode, call SSL_set_blocking_mode() with I<blocking> set to 1;
  16. to disable it, call SSL_set_blocking_mode() with I<blocking> set to 0.
  17. To retrieve the current blocking mode, call SSL_get_blocking_mode().
  18. Blocking mode means that calls such as SSL_read() and SSL_write() will block
  19. until the requested operation can be performed. In nonblocking mode, these
  20. calls will fail if the requested operation cannot be performed immediately; see
  21. L<SSL_get_error(3)>.
  22. These functions are only applicable to QUIC connection SSL objects. Other kinds
  23. of SSL object, such as those for TLS, automatically function in blocking or
  24. nonblocking mode based on whether the underlying network read and write BIOs
  25. provided to the SSL object are themselves configured in nonblocking mode.
  26. Where a QUIC connection SSL object is used in nonblocking mode, an application
  27. is responsible for ensuring that the SSL object is ticked regularly; see
  28. L<SSL_handle_events(3)>.
  29. Blocking mode is disabled automatically if the application provides a QUIC
  30. connection SSL object with a network BIO which cannot support blocking mode. To
  31. re-enable blocking mode in this case, an application must set a network BIO
  32. which can support blocking mode and explicitly call SSL_set_blocking_mode().
  33. =head1 RETURN VALUES
  34. SSL_set_blocking_mode() returns 1 on success and 0 on failure. The function
  35. fails if called on a SSL object which does not represent a QUIC connection,
  36. or if blocking mode cannot be used for the given connection.
  37. SSL_get_blocking_mode() returns 1 if blocking is currently enabled. It returns
  38. -1 if called on an unsupported SSL object.
  39. =head1 SEE ALSO
  40. L<SSL_handle_events(3)>, L<ssl(7)>
  41. =head1 HISTORY
  42. The SSL_set_blocking_mode() and SSL_get_blocking_mode() functions were added in
  43. OpenSSL 3.2.
  44. =head1 COPYRIGHT
  45. Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
  46. Licensed under the Apache License 2.0 (the "License"). You may not use
  47. this file except in compliance with the License. You can obtain a copy
  48. in the file LICENSE in the source distribution or at
  49. L<https://www.openssl.org/source/license.html>.
  50. =cut