Skip to content

Commit

Permalink
http2: use correct connect event for TLS Socket
Browse files Browse the repository at this point in the history
PR-URL: #17328
Fixes: #15303
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
  • Loading branch information
jasnell authored and MylesBorins committed Dec 7, 2017
1 parent 18652b6 commit d607718
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,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();
}
Expand Down

0 comments on commit d607718

Please sign in to comment.