Skip to content

tls: accept empty net.Sockets#1046

Closed
indutny wants to merge 1 commit into
nodejs:v1.xfrom
indutny:fix/gh-987
Closed

tls: accept empty net.Sockets#1046
indutny wants to merge 1 commit into
nodejs:v1.xfrom
indutny:fix/gh-987

Conversation

@indutny

@indutny indutny commented Mar 3, 2015

Copy link
Copy Markdown
Member

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

cc @iojs/streams @iojs/crypto @iojs/collaborators

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
Comment thread lib/_tls_wrap.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional change?

Copy link
Copy Markdown
Member Author

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 :)

@bnoordhuis

Copy link
Copy Markdown
Member

LGTM. What does the CI say?

@indutny

indutny commented Mar 3, 2015

Copy link
Copy Markdown
Member Author

@rvagg

rvagg commented Mar 3, 2015

Copy link
Copy Markdown
Member

does the test cover the same reduced case you narrowed down in #987?

@indutny

indutny commented Mar 3, 2015

Copy link
Copy Markdown
Member Author

Yes.

@rvagg

rvagg commented Mar 3, 2015

Copy link
Copy Markdown
Member

:shipit: 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.

@indutny

indutny commented Mar 3, 2015

Copy link
Copy Markdown
Member Author

@rvagg second one is actually a continuation of this. I decided to do the simple first and harder later :)

indutny added a commit that referenced this pull request Mar 3, 2015
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>
@indutny

indutny commented Mar 3, 2015

Copy link
Copy Markdown
Member Author

Landed in 7b3b8ac, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants