-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tls: accept empty net.Socket
s
#1046
Conversation
Accept `new net.Socket()` as a `socket` option to `tls.connect()` without triggering an assertion error in C++. This is done by wrapping it into a JSStream to ensure that there will be a handle at the time of wrapping the socket into TLSSocket. Fix: nodejs#987
@@ -506,6 +513,7 @@ TLSSocket.prototype._start = function() { | |||
return; | |||
} | |||
|
|||
debug('start'); |
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.
Intentional change?
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.
Yeah, I'm tired of putting console.log()
here during debugging :)
LGTM. What does the CI say? |
does the test cover the same reduced case you narrowed down in #987? |
Yes. |
I have no opinion on which one of the two options to presented in #987 except that you've produced code for one of them so it wins. |
@rvagg second one is actually a continuation of this. I decided to do the simple first and harder later :) |
Accept `new net.Socket()` as a `socket` option to `tls.connect()` without triggering an assertion error in C++. This is done by wrapping it into a JSStream to ensure that there will be a handle at the time of wrapping the socket into TLSSocket. Fix: #987 PR-URL: #1046 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
Landed in 7b3b8ac, thank you! |
Accept
new net.Socket()
as asocket
option totls.connect()
without triggering an assertion error in C++.
This is done by wrapping it into a JSStream to ensure that there will be
a handle at the time of wrapping the socket into TLSSocket.
Fix: #987
cc @iojs/streams @iojs/crypto @iojs/collaborators