-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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.
PR-URL: #32958 Fixes: #32922 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Landed in 6a07eca |
PR-URL: #32958 Fixes: #32922 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #32958 Fixes: #32922 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #32958 Fixes: #32922 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
@@ -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.
PR-URL: #32958 Fixes: #32922 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
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