-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http2: wait for secureConnect before initializing #32958
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Landed in 6a07eca |
@@ -464,6 +464,7 @@ function TLSSocket(socket, opts) { | |||
this._securePending = false; | |||
this._newSessionPending = false; | |||
this._controlReleased = false; | |||
this.secureConnecting = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never set to false
on client sockets.
So if Http2Session
constructor (in lib/internal/http2/core.js
) is called after secureConnect
is emitted, then secureConnecting
is still true
but it'll end up never calling setupHandle
and connect
will never be emitted.
As @murgatroid99 points out in #32922, a connection may have its
connecting
property set totrue
, while TLS is still connecting. This results insetupFn()
being fired before the connection is actually ready.This PR introduces the property
secureConnecting
onTLSSocket
, which will not be set totrue
until thesecureConnection
event is emitted.Fixes: #32922
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes