diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 1fc339cc2e85af..b07812f1a66fea 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -214,7 +214,7 @@ function requestOCSPDone(socket) {
}
-function onnewsession(key, session) {
+function onnewsession(sessionId, session) {
const owner = this[owner_symbol];
if (!owner.server)
@@ -238,7 +238,7 @@ function onnewsession(key, session) {
};
owner._newSessionPending = true;
- if (!owner.server.emit('newSession', key, session, done))
+ if (!owner.server.emit('newSession', sessionId, session, done))
done();
}
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 8d5ac869196318..201b1815e1ae80 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -1510,20 +1510,20 @@ int SSLWrap::NewSessionCallback(SSL* s, SSL_SESSION* sess) {
return 0;
// Serialize session
- Local