From ec4c5a9fc278571cddf5eebb25dc820535a3bcf8 Mon Sep 17 00:00:00 2001 From: Mateusz Krawczuk Date: Fri, 19 Jun 2020 20:06:36 +0200 Subject: [PATCH] [WIP] tls: add server.sessionTimeout getter and setter. This change enables dynamical change of tls.Server's session timeout. TODO: * finish tests * add doc --- doc/api/tls.md | 14 ++ lib/_tls_wrap.js | 7 + src/node_crypto.cc | 10 ++ src/node_crypto.h | 2 + test/parallel/test-tls-session-timeout.js | 152 ++++++++++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 test/parallel/test-tls-session-timeout.js diff --git a/doc/api/tls.md b/doc/api/tls.md index e294a75f919a3d..5a483468cecbc4 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -629,6 +629,20 @@ Existing or currently pending server connections will use the previous keys. See [Session Resumption][] for more information. +### `server.getSessionTimeout()` + +* Returns: {number} The number of seconds after which a TLS session + created by the server will no longer be resumable. + + Returns the session timeout in seconds. + +### `server.setSessionTimeout(sessionTimeout)` + +* `sessionTimeout` {number} The number of seconds after which a TLS session + created by the server will no longer be resumable. + + Sets the session timeout. + TODO (changed dynamically/for further connections?) ## Class: `tls.TLSSocket`