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 <[email protected]>
Reviewed-By: Sebastiaan Deckers <[email protected]>
  • Loading branch information
jasnell authored and MylesBorins committed Dec 7, 2017
1 parent 88f05a9 commit c81e968
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 c81e968

Please sign in to comment.