SSL_CTX_set_num_tickets.pod 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. =pod
  2. =head1 NAME
  3. SSL_set_num_tickets,
  4. SSL_get_num_tickets,
  5. SSL_CTX_set_num_tickets,
  6. SSL_CTX_get_num_tickets,
  7. SSL_new_session_ticket
  8. - control the number of TLSv1.3 session tickets that are issued
  9. =head1 SYNOPSIS
  10. #include <openssl/ssl.h>
  11. int SSL_set_num_tickets(SSL *s, size_t num_tickets);
  12. size_t SSL_get_num_tickets(SSL *s);
  13. int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets);
  14. size_t SSL_CTX_get_num_tickets(SSL_CTX *ctx);
  15. int SSL_new_session_ticket(SSL *s);
  16. =head1 DESCRIPTION
  17. SSL_CTX_set_num_tickets() and SSL_set_num_tickets() can be called for a server
  18. application and set the number of TLSv1.3 session tickets that will be sent to
  19. the client after a full handshake. Set the desired value (which could be 0) in
  20. the B<num_tickets> argument. Typically these functions should be called before
  21. the start of the handshake.
  22. The default number of tickets is 2; the default number of tickets sent following
  23. a resumption handshake is 1 but this cannot be changed using these functions.
  24. The number of tickets following a resumption handshake can be reduced to 0 using
  25. custom session ticket callbacks (see L<SSL_CTX_set_session_ticket_cb(3)>).
  26. Tickets are also issued on receipt of a post-handshake certificate from the
  27. client following a request by the server using
  28. L<SSL_verify_client_post_handshake(3)>. These new tickets will be associated
  29. with the updated client identity (i.e. including their certificate and
  30. verification status). The number of tickets issued will normally be the same as
  31. was used for the initial handshake. If the initial handshake was a full
  32. handshake then SSL_set_num_tickets() can be called again prior to calling
  33. SSL_verify_client_post_handshake() to update the number of tickets that will be
  34. sent.
  35. To issue tickets after other events (such as application-layer changes),
  36. SSL_new_session_ticket() is used by a server application to request that a new
  37. ticket be sent when it is safe to do so. New tickets are only allowed to be
  38. sent in this manner after the initial handshake has completed, and only for TLS
  39. 1.3 connections. The ticket generation and transmission are delayed until the
  40. server is starting a new write operation, so that it is bundled with other
  41. application data being written and properly aligned to a record boundary.
  42. SSL_new_session_ticket() can be called more than once to request additional
  43. tickets be sent; all such requests are queued and written together when it is
  44. safe to do so. Note that a successful return from SSL_new_session_ticket()
  45. indicates only that the request to send a ticket was processed, not that the
  46. ticket itself was sent. To be notified when the ticket itself is sent, a
  47. new-session callback can be registered with L<SSL_CTX_sess_set_new_cb(3)> that
  48. will be invoked as the ticket or tickets are generated.
  49. SSL_CTX_get_num_tickets() and SSL_get_num_tickets() return the number of
  50. tickets set by a previous call to SSL_CTX_set_num_tickets() or
  51. SSL_set_num_tickets(), or 2 if no such call has been made.
  52. =head1 RETURN VALUES
  53. SSL_CTX_set_num_tickets(), SSL_set_num_tickets(), and
  54. SSL_new_session_ticket() return 1 on success or 0 on failure.
  55. SSL_CTX_get_num_tickets() and SSL_get_num_tickets() return the number of tickets
  56. that have been previously set.
  57. =head1 SEE ALSO
  58. L<ssl(7)>
  59. =head1 HISTORY
  60. SSL_new_session_ticket() was added in OpenSSL 3.0.0.
  61. SSL_set_num_tickets(), SSL_get_num_tickets(), SSL_CTX_set_num_tickets(), and
  62. SSL_CTX_get_num_tickets() were added in OpenSSL 1.1.1.
  63. =head1 COPYRIGHT
  64. Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
  65. Licensed under the Apache License 2.0 (the "License"). You may not use
  66. this file except in compliance with the License. You can obtain a copy
  67. in the file LICENSE in the source distribution or at
  68. L<https://www.openssl.org/source/license.html>.
  69. =cut