Permalink
Browse files

http2: use correct connect event for TLS Socket

PR-URL: #17328
Fixes: #15303
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
  • Loading branch information...
jasnell committed Nov 24, 2017
1 parent 0fb1e07 commit f3686f2a4dc017d998a057f7fa6107e36a721641
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/internal/http2/core.js
@@ -707,7 +707,9 @@ class Http2Session extends EventEmitter {
const setupFn = setupHandle(this, socket, type, options);
if (socket.connecting) {
this[kState].connecting = true;
socket.once('connect', setupFn);
const connectEvent =
socket instanceof tls.TLSSocket ? 'secureConnect' : 'connect';
socket.once(connectEvent, setupFn);
} else {
setupFn();
}

0 comments on commit f3686f2

Please sign in to comment.