Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc: add TLS session resumption example
Using TLS session resumption correctly is not obvious. This added
example code should help new users understand how to use it correctly.

Related issue: #3132
  • Loading branch information
silverwind committed Oct 6, 2015
commit 3ea5a6094c01469c5b41c50f712e886d6aea403f
10 changes: 10 additions & 0 deletions doc/api/tls.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down