Closed
Conversation
cherry-pick 802a2e7 from v6-staging. ALPN is added to tls according to RFC7301, which supersedes NPN. When the server receives both NPN and ALPN extensions from the client, ALPN takes precedence over NPN and the server does not send NPN extension to the client. alpnProtocol in TLSSocket always returns false when no selected protocol exists by ALPN. In https server, http/1.1 token is always set when no options.ALPNProtocols exists. PR-URL: nodejs#2564 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
cherry-pick 7eee372 from v6-staging. This fix is to be consistent implementation with ALPN. Tow NPN protocol data in the persistent memebers move to hidden variables in the wrap object. PR-URL: nodejs#2564 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
cherry-pick 65030c7 from v6-staging. openssl/openssl@af2db04 changed some ALPN behaviors. The tests when ALPN has no selection should be fixed because openssl was changed NPN callback to be invoked in this case. Fixes: nodejs#6458 PR-URL: nodejs#6550 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
cherry-pick c26b9af from v6-staging. `convertNPNProtocols` and `convertALPNProtocols' uses the `protocols` buffer object as it is, and if it is modified outside of core, it might have an impact. This patch makes a copy of the buffer object, before using it. PR-URL: nodejs#8055 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Contributor
Author
|
CI is running on https://ci.nodejs.org/job/node-test-pull-request/5879/ . |
bnoordhuis
approved these changes
Jan 16, 2017
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
LGTM with two suggestions.
src/node_crypto.cc
Outdated
| return env->ThrowTypeError("Must give a Buffer as first argument"); | ||
|
|
||
| w->npn_protos_.Reset(args.GetIsolate(), args[0].As<Object>()); | ||
| Local<Value> npn_buffer = Local<Value>::New(env->isolate(), args[0]); |
Member
There was a problem hiding this comment.
Local<Value> npn_buffer = args[0]? Could be folded into the SetHiddenValue() call below.
src/node_crypto.cc
Outdated
| int r = SSL_set_alpn_protos(w->ssl_, alpn_protos, alpn_protos_len); | ||
| CHECK_EQ(r, 0); | ||
| } else { | ||
| Local<Value> alpn_buffer = Local<Value>::New(env->isolate(), args[0]); |
Contributor
Author
There was a problem hiding this comment.
This is also fixed.
The Local variables of `npn_buffer` and `alpn_buffer` are not necessary to be created from `args[0]`. Remove and fold them into the subsequent call.
jasnell
approved these changes
Jan 16, 2017
Member
|
CI looks good. @nodejs/lts any comments before landing? Will look at getting this landed tomorrow if there are no objections. |
MylesBorins
pushed a commit
that referenced
this pull request
Jan 19, 2017
The Local variables of `npn_buffer` and `alpn_buffer` are not necessary to be created from `args[0]`. Remove and fold them into the subsequent call. PR-URL: #10831 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Contributor
|
landed in 151cca6...4341166 |
MylesBorins
pushed a commit
that referenced
this pull request
Jan 24, 2017
The Local variables of `npn_buffer` and `alpn_buffer` are not necessary to be created from `args[0]`. Remove and fold them into the subsequent call. PR-URL: #10831 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
Feb 1, 2017
The Local variables of `npn_buffer` and `alpn_buffer` are not necessary to be created from `args[0]`. Remove and fold them into the subsequent call. PR-URL: #10831 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
tls,crypto
As listed in nodejs/Release#177, this backports the ALPN feature to v4.x LTS by cherry-picking four commits of 802a2e7, 7eee372, 65030c7 and c26b9af from v6-staging with resolving several conflicts.
/CC @nodejs/crypto @MylesBorins