Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Add missing options argument to createSecurePair. #25109

Closed
wants to merge 2 commits into from
Closed

Add missing options argument to createSecurePair. #25109

wants to merge 2 commits into from

Conversation

socketpair
Copy link

Also helps in implementation of #6204, where some ptions passed to
createSecurePair and ignored before this patch.

These options are very helpful if someone wants to pass
options.servername or options.SNICallback to securepair.

socketpair referenced this pull request May 5, 2015
Allow wrapping TLSSocket inside another TLSSocket, emulate it using
SecurePair in legacy APIs.

fix #6204
@indutny
Copy link
Member

indutny commented May 7, 2015

Great! May I ask you to add a test to not let this slip away again?

@socketpair
Copy link
Author

Tests sems valid, but does not work...another bug is blocking my test...:

@indutny need your help. Да, удобнее по-русски, кстати.

=== release test-tls-securepair-fiftharg ===                    
Path: pummel/test-tls-securepair-fiftharg
node: ../src/async-wrap-inl.h:98: v8::Handle<v8::Value> node::AsyncWrap::MakeCallback(v8::Handle<v8::String>, int, v8::Handle<v8::Value>*): Assertion `cb_v->IsFunction()' failed.
Command: out/Release/node ********/node/test/pummel/test-tls-securepair-fiftharg.js

Exactly the same is reproduced with code

pair = tls.createSecurePair(...);
pair.ssl.setSNICallback(function() {});

but pair.ssl is undocumented (and should not be documented, as I think).

Also, seems not reproducible in nodejs 0.10. Also maybe that: #7691 ?

indutny added a commit to indutny/io.js that referenced this pull request May 17, 2015
`onselect` is set on the `sniObject_` not on the `Connection` instance.

See: nodejs/node-v0.x-archive#25109
@indutny
Copy link
Member

indutny commented May 17, 2015

@socketpair there is a bug that should be fixed by nodejs/node#1720

@indutny
Copy link
Member

indutny commented May 17, 2015

cc @misterdjules please backport this if it sounds good to you! ;)

@indutny
Copy link
Member

indutny commented May 17, 2015

Btw, why put this test into pummel folder?

@socketpair
Copy link
Author

I don't know. I just see some tests about tls in that folder, and put my test in same folder. I can change PR if you say what to fix.

@indutny
Copy link
Member

indutny commented May 17, 2015

I'd go with test/simple ;) Btw, you could probably try to rebase your branch on top of nodejs/node#1720 to include the fix commit in this PR, and to make sure that it builds correctly.

`onselect` is set on the `sniObject_` not on the `Connection` instance.

See: #25109
@socketpair
Copy link
Author

I have cherry-picked commit from IOjs that fixed bug in C++

@socketpair
Copy link
Author

I have moved test from pummel to simple dir

@socketpair
Copy link
Author

Now all tests passed! yay! Please merge!

@@ -582,6 +582,8 @@ and the cleartext one is used as a replacement for the initial encrypted stream.
automatically reject clients with invalid certificates. Only applies to
servers with `requestCert` enabled.

- `options`: An object with common SSL options. See [new tls.TLSSocket][].
Copy link
Author

Choose a reason for hiding this comment

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

not sure if markdown syntax (link) is correct here

@socketpair
Copy link
Author

How to speedup merging? who is responsible?


// captured trafic from browser's request to https://www.google.com
var ssl_hello_with_SNI = new Buffer([
22,3,1,2,0,1,0,1,252,3,3,123,36,32,232,194,245,125,208,188,197,238,164,123,101,37,21,189,4,223,219,197,179,76,
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, but we use 80 column limit everywhere. I may only suggest to convert this to hex and split it before it gets to 80 column. It will be much more compact this way.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@indutny
Copy link
Member

indutny commented Jun 3, 2015

Sorry for delay! Just one minor nit, otherwise LGTM!

Also helps in implementation of #6204, where some options passed to
createSecurePair and ignored before this patch.

These options are very helpful if someone wants to pass
options.servername or options.SNICallback to securepair.
@socketpair
Copy link
Author

Hex encoding takess too much space. Just reformat decimal representation.

indutny added a commit to indutny/io.js that referenced this pull request Jul 22, 2015
`onselect` is set on the `sniObject_` not on the `Connection` instance.

See: nodejs/node-v0.x-archive#25109
PR-URL: nodejs#1720
Reviewed-By: Ben Noordhuis <[email protected]>
indutny added a commit to nodejs/node that referenced this pull request Jul 22, 2015
`onselect` is set on the `sniObject_` not on the `Connection` instance.

See: nodejs/node-v0.x-archive#25109
PR-URL: #1720
Reviewed-By: Ben Noordhuis <[email protected]>
@indutny
Copy link
Member

indutny commented Jul 22, 2015

@socketpair what do you think about reopening this PR for io.js master branch? I have just landed that fix commit that your PR depended upon. ;)

@socketpair
Copy link
Author

I'm confused about everything, and forgot what is happening... :( There are nodejs, iojs and two patches in both projects.

I want all fixes to be in both projects. What I should do so?

@indutny
Copy link
Member

indutny commented Jul 23, 2015

@socketpair it can't go into v0.12, and so the next release of node is io.js :) I would suggest to open PR for io.js master ;)

@indutny
Copy link
Member

indutny commented Jul 24, 2015

Don't forget to cc me there ;)

@jasnell
Copy link
Member

jasnell commented Aug 16, 2015

@socketpair .. just to reiterate what @indutny said. This is not going to be able to land here. The right thing to do here would be to open a new PR against master on https://github.com/nodejs/node in order to get this landed.

@socketpair
Copy link
Author

@jasnell thanks for detailed explanation what should be done.
@indutny CC to you :)

nodejs/node#2441

Should I close this pull request ?

@jasnell
Copy link
Member

jasnell commented Aug 19, 2015

@socketpair .. no problem. I'll go ahead and close the PR here. Thanks!

@jasnell jasnell closed this Aug 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants