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

tls: Update cipher-list defaults, add command-line switches #14383

Closed

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Apr 1, 2015

  1. Pull over the io.js default cipher list updates
  2. Adds new --cipher-list and --enable-legacy-cipher-list command line switches.
    --cipher-list allows a new default cipher list to be specified
    --enable-legacy-cipher-list tells node to use specific older cipher lists
  3. Adds new NODE_CIPHER_LIST and NODE_LEGACY_CIPHER_LIST
    environment variables as alternatives to the command line switches
  4. Adds a new getLegacyCiphers method to the TLS module
  5. A test case is included.

Port of io.js commit: nodejs/node@77f3586

Original commit message:

This updates the default cipher suite to an more secure list, which
prefers strong ciphers with Forward Secrecy. Additionally, it enables
`honorCipherOrder` by default.

Noteable effect of this change is that the insecure RC4 ciphers are
disabled and that Chrome negotiates a more secure ECDHE cipher.

Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
PR-URL: nodejs/node#826
@jasnell jasnell added this to the 0.13.1 milestone Apr 1, 2015
@jasnell jasnell self-assigned this Apr 1, 2015
@jasnell jasnell force-pushed the tls-update-cipher-suite-with-switches branch from b72acf0 to 025dd75 Compare April 2, 2015 20:36
@jasnell
Copy link
Member Author

jasnell commented Apr 2, 2015

(This is just for master... separate PR's will be coming for backporting changes into
v.0.12.x and v0.10.x)

/cc @joyent/node-coreteam

@jasnell jasnell force-pushed the tls-update-cipher-suite-with-switches branch from 025dd75 to 008ccd9 Compare April 2, 2015 20:52
@jasnell
Copy link
Member Author

jasnell commented Apr 2, 2015

There will be just a couple more updates on this coming soon.. just a few minor late breaking tweaks...

Add command line switches and environment variables to override
the default cipher suite in tls.js

`--cipher-list` and `NODE_CIPHER_LIST` can be used to completely
override the default cipher list with a given value.

`--enable-legacy-cipher-list` and `NODE_LEGACY_CIPHER_LIST` can
be used to reset the default cipher list back to a known legacy
value shipped in prior Node.js releases

A new `getLegacyCiphers` method on the tis module allows
programmatic access to the old cipher list defaults.
@jasnell jasnell force-pushed the tls-update-cipher-suite-with-switches branch from 008ccd9 to 12c3a57 Compare April 2, 2015 23:21
" set to v0.10.38 to use the v0.10.38 list,\n"
" set to v0.10.39 to use the v0.10.39 list.\n"
" set to v0.12.2 to use the v0.12.2 list.\n"
" set to v0.12.3 to use the v0.12.3 list.\n"

Choose a reason for hiding this comment

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

I think it would be enough to simply list possible options. users could probably figure out from context that each one corresponds to a given version.

Copy link
Member Author

Choose a reason for hiding this comment

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

;) one hopes, yes.
On Apr 3, 2015 1:25 PM, "Trevor Norris" [email protected] wrote:

In src/node.cc
#14383 (comment):

@@ -2929,6 +2929,12 @@ static void PrintHelp() {
#endif
" --enable-ssl2 enable ssl2\n"
" --enable-ssl3 enable ssl3\n"

  •     "  --cipher-list=val    specify the default TLS cipher list\n"
    
  •     "  --enable-legacy-cipher-list=val \n"
    
  •     "                       set to v0.10.38 to use the v0.10.38 list,\n"
    
  •     "                       set to v0.10.39 to use the v0.10.39 list.\n"
    
  •     "                       set to v0.12.2 to use the v0.12.2 list.\n"
    
  •     "                       set to v0.12.3 to use the v0.12.3 list.\n"
    

I think it would be enough to simply list possible options. users could
probably figure out from context that each one corresponds to a given
version.


Reply to this email directly or view it on GitHub
https://github.com/joyent/node/pull/14383/files#r27753373.

@trevnorris
Copy link

Few small things, but looking good.

jasnell added 2 commits April 6, 2015 11:39
Based on commit feedback, make the PrintHelp for
--enable-legacy-cipher-list less verbose.
Per the commit feedback, fix up style nits and pass in the
isolate with the NODE_DEFINE_STRING_CONSTANT macro.
@mhdawson
Copy link
Member

mhdawson commented Apr 7, 2015

Reviewed for consistency with 0.12 and 0.10 patches looks good. Differences between them also make sense. This looks like changes from original io.js patch plus the changes for 0.10.X and 0.12.X. Will need to squash and ensure final commit comment is less than 50 char limit but otherwise lgtm.

@@ -3040,6 +3047,20 @@ static void ParseArgs(int* argc,
} else if (strcmp(arg, "--v8-options") == 0) {
new_v8_argv[new_v8_argc] = "--help";
new_v8_argc += 1;
} else if (strncmp(arg, "--cipher-list=", 14) == 0) {

Choose a reason for hiding this comment

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

Could this be done in src/node.js instead of in src/node.cc? It seems it would just be less error prone and shorter.

@misterdjules
Copy link

@jasnell Added some comments, sorry again for taking so long in reviewing this!

@misterdjules
Copy link

@jasnell Running the tests suite in test/external/ssl-options/test.js with these changes now, I'll keep you posted about the results.

@misterdjules
Copy link

@jasnell All tests in test/external/ssl-options/test.js pass.

@jasnell
Copy link
Member Author

jasnell commented Apr 8, 2015

+1... my time tonight is disappearing quick so I will work on landing these
in the morning. Thank you very much for the additional review Julien. It's
very helpful

On Tue, Apr 7, 2015 at 5:42 PM, Julien Gilli [email protected]
wrote:

@jasnell https://github.com/jasnell All tests in
test/external/ssl-options/test.js pass.


Reply to this email directly or view it on GitHub
#14383 (comment).

typo and unnecessary options init
jasnell added a commit that referenced this pull request Apr 8, 2015
Port of io.js commit: nodejs/node@77f3586

Original commit message:

This updates the default cipher suite to an more secure list, which
prefers strong ciphers with Forward Secrecy. Additionally, it enables
`honorCipherOrder` by default.

Noteable effect of this change is that the insecure RC4 ciphers are
disabled and that Chrome negotiates a more secure ECDHE cipher.

Reviewed-By: James M Snell <[email protected]>
PR-URL: #14383
jasnell added a commit that referenced this pull request Apr 8, 2015
Add command line switches and environment variables to override
the default cipher suite in tls.js

`--cipher-list` and `NODE_CIPHER_LIST` can be used to completely
override the default cipher list with a given value.

`--enable-legacy-cipher-list` and `NODE_LEGACY_CIPHER_LIST` can
be used to reset the default cipher list back to a known legacy
value shipped in prior Node.js releases

A new `getLegacyCiphers` method on the tis module allows
programmatic access to the old cipher list defaults.

Reviewed-By: James M Snell <[email protected]>
PR-URL: #14383
jasnell added a commit that referenced this pull request Apr 8, 2015
Based on commit feedback, make the PrintHelp for
--enable-legacy-cipher-list less verbose.

Reviewed-By: James M Snell <[email protected]>
PR-URL: #14383
jasnell added a commit that referenced this pull request Apr 8, 2015
Per the commit feedback, fix up style nits and pass in the
isolate with the NODE_DEFINE_STRING_CONSTANT macro.

Reviewed-By: James M Snell <[email protected]>
PR-URL: #14383
jasnell added a commit that referenced this pull request Apr 8, 2015
typo and unnecessary options init

Reviewed-By: James M Snell <[email protected]>
PR-URL: #14383
@jasnell
Copy link
Member Author

jasnell commented Apr 8, 2015

Landed

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.

6 participants