SSL_set_incoming_stream_policy.pod 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. =pod
  2. =head1 NAME
  3. SSL_set_incoming_stream_policy, SSL_INCOMING_STREAM_POLICY_AUTO,
  4. SSL_INCOMING_STREAM_POLICY_ACCEPT,
  5. SSL_INCOMING_STREAM_POLICY_REJECT - manage the QUIC incoming stream
  6. policy
  7. =head1 SYNOPSIS
  8. #include <openssl/ssl.h>
  9. #define SSL_INCOMING_STREAM_POLICY_AUTO
  10. #define SSL_INCOMING_STREAM_POLICY_ACCEPT
  11. #define SSL_INCOMING_STREAM_POLICY_REJECT
  12. int SSL_set_incoming_stream_policy(SSL *conn, int policy,
  13. uint64_t app_error_code);
  14. =head1 DESCRIPTION
  15. SSL_set_incoming_stream_policy() policy changes the incoming stream policy for a
  16. QUIC connection. Depending on the policy configured, OpenSSL QUIC may
  17. automatically reject incoming streams initiated by the peer. This is intended to
  18. ensure that legacy applications using single-stream operation with a default
  19. stream on a QUIC connection SSL object are not passed remotely-initiated streams
  20. by a peer which those applications are not prepared to handle.
  21. I<app_error_code> is an application error code which will be used in any QUIC
  22. B<STOP_SENDING> or B<RESET_STREAM> frames generated to implement the policy. The
  23. default application error code is 0.
  24. The valid values for I<policy> are:
  25. =over 4
  26. =item SSL_INCOMING_STREAM_POLICY_AUTO
  27. This is the default setting. Incoming streams are accepted according to the
  28. following rules:
  29. =over 4
  30. =item *
  31. If the default stream mode (configured using L<SSL_set_default_stream_mode(3)>)
  32. is set to B<SSL_DEFAULT_STREAM_MODE_AUTO_BIDI> (the default) or
  33. B<SSL_DEFAULT_STREAM_MODE_AUTO_UNI>, the incoming stream is rejected.
  34. =item *
  35. Otherwise (where the default stream mode is B<SSL_DEFAULT_STREAM_MODE_NONE>),
  36. the application is assumed to be stream aware, and the incoming stream is
  37. accepted.
  38. =back
  39. =item SSL_INCOMING_STREAM_POLICY_ACCEPT
  40. Always accept incoming streams, allowing them to be dequeued using
  41. L<SSL_accept_stream(3)>.
  42. =item SSL_INCOMING_STREAM_POLICY_REJECT
  43. Always reject incoming streams.
  44. =back
  45. Where an incoming stream is rejected, it is rejected immediately and it is not
  46. possible to gain access to the stream using L<SSL_accept_stream(3)>. The stream
  47. is rejected using QUIC B<STOP_SENDING> and B<RESET_STREAM> frames as
  48. appropriate.
  49. =head1 RETURN VALUES
  50. Returns 1 on success and 0 on failure.
  51. This function fails if called on a QUIC stream SSL object, or on a non-QUIC SSL
  52. object.
  53. =head1 SEE ALSO
  54. L<SSL_set_default_stream_mode(3)>, L<SSL_accept_stream(3)>
  55. =head1 HISTORY
  56. SSL_set_incoming_stream_policy() was added in OpenSSL 3.2.
  57. =head1 COPYRIGHT
  58. Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
  59. Licensed under the Apache License 2.0 (the "License"). You may not use
  60. this file except in compliance with the License. You can obtain a copy
  61. in the file LICENSE in the source distribution or at
  62. L<https://www.openssl.org/source/license.html>.
  63. =cut