From 3911595188ca0a2cff09569a6661aa25abc327af Mon Sep 17 00:00:00 2001 From: Mateusz Krawczuk Date: Mon, 22 Jun 2020 19:08:15 +0200 Subject: [PATCH 1/2] tls: add getter and setter for session ticket number. --- doc/api/tls.md | 28 +++++++++++++++++++ lib/_tls_common.js | 4 +++ lib/_tls_wrap.js | 14 +++++++++- src/node_crypto.cc | 28 +++++++++++++++++++ src/node_crypto.h | 2 ++ test/parallel/test-tls-num-tickets.js | 40 +++++++++++++++++++++++++++ 6 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-tls-num-tickets.js diff --git a/doc/api/tls.md b/doc/api/tls.md index 9b06fde493e6a2..48ce27412b9a37 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -629,6 +629,30 @@ Existing or currently pending server connections will use the previous keys. See [Session Resumption][] for more information. +### `server.getNumTickets()` + + +* Returns: {number} A number of session tickets. + +Returns the number of session tickets that are sent to the client after +a full handshake. + +See [SSL_CTX_get_num_tickets][] for more information. + +### `server.setNumTickets(numTickets)` + + +* `numTickets` {number} A number of session tickets. + +Sets the number of session tickets that are sent to the client after +a full handshake. + +See [SSL_CTX_set_num_tickets][] for more information. + ## Class: `tls.TLSSocket`