diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index 93779e54bc2..eb98328fceb 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -603,6 +603,16 @@ perform lookup in external storage using given `sessionId`, and invoke NOTE: adding this event listener will have an effect only on connections established after addition of event listener. +Here's an example for using TLS session resumption: + + var tlsSessionStore = {}; + server.on('newSession', function(id, data, cb) { + tlsSessionStore[id.toString('hex')] = data; + cb(); + }); + server.on('resumeSession', function(id, cb) { + cb(null, tlsSessionStore[id.toString('hex')] || null); + }); ### Event: 'OCSPRequest'