-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: set ecdhCurve default to 'auto' #16853
Conversation
/cc @nodejs/crypto |
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.
Removing tls.DEFAULT_ECDH_CURVE
outright is not an option: it's documented and in use in the ecosystem. (edit: Whether it actually worked as intended before v8.6.0 is something of an open question, though.)
Changing it to 'auto'
however should be acceptable for node 10.
@bnoordhuis I've updated my commit. |
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.
LGTM
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.
Thanks, LGTM.
CI failure on AIX is unrelated. CI is good. |
doc/api/tls.md
Outdated
@@ -1154,7 +1154,7 @@ added: v0.11.13 | |||
--> | |||
|
|||
The default curve name to use for ECDH key agreement in a tls server. The | |||
default value is `'prime256v1'` (NIST P-256). Consult [RFC 4492] and | |||
default value is `'auto'`. Consult [RFC 4492] and |
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.
I searched RFC 4492 and FIPS 186-4 for the word auto
, and it does not appear. Could you provide a little more text that says something about what this new value actually does? IIRC, this curve is used for creation of ephemeral ECDH keys, is it that auto will cause the curve used to be the same as the curve in the server's EC certificate?
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.
I would prefer to update the included references. auto
is not part of the RFC AFAIK, but rather an OpenSSL definition. Otherwise LGTM.
@sam-github @tniessen I've updated my commit. |
doc/api/tls.md
Outdated
@@ -1154,8 +1154,7 @@ added: v0.11.13 | |||
--> | |||
|
|||
The default curve name to use for ECDH key agreement in a tls server. The | |||
default value is `'prime256v1'` (NIST P-256). Consult [RFC 4492] and | |||
[FIPS.186-4] for more details. | |||
default value is `'auto'`. OpenSSL will choose the curve automatically, see the [OpenSSL set curve documentation]. |
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.
This line should not exceed 80 characters if possible. Also, the description of the ecdhCurve
option in tls.createSecureContext
already covers what auto
means, I would prefer to link to that instead of the OpenSSL documentation. Maybe something like
default value is `'auto'`. See [`tls.createSecureContext()`] for further information.
I guess most users will assume this behavior, auto
is a pretty self-explanatory name.
For best out-of-the-box compatibility there should not be one default `ecdhCurve` for the tls client, OpenSSL should choose them automatically. I've had a lot of struggle connecting to a server that did not support the default curve. Many third party modules have no support for setting `ecdhCurve`, therefore I think the tls client should support as much curves as possible by default. Using `'auto'` would achieve this. Refs: #16196 Refs: #1495 Refs: https://wiki.openssl.org/index.php/Manual:SSL_CTX_set1_curves(3) Refs: #15206
@tniessen I've updated my commit again, using your suggestion. |
CI is not longer visible so starting a new one: https://ci.nodejs.org/job/node-test-pull-request/11785/ |
For best out-of-the-box compatibility there should not be one default `ecdhCurve` for the tls client, OpenSSL should choose them automatically. See https://wiki.openssl.org/index.php/Manual:SSL_CTX_set1_curves(3) PR-URL: #16853 Refs: #16196 Refs: #1495 Refs: #15206 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
CI failures are unrelated (centos6-64 is failing on all PRs and AIX is async-hooks/test-graph.signal once again). Landed in af78840, thank you! 🎉 We are looking forward to future contributions! |
@tniessen What release version(s) will that commit be part of? |
@jacobcabantomski-ct This PR was marked as semver-major, so these changes will not be shipped until node 10 is released. |
@jacobcabantomski-ct and @nodejs/crypto and @nodejs/lts - would there be interest in my PRing a |
@sam-github That would be very helpful in the short/medium term until 10 is out next fall. |
|
@sam-github any chance you are going to have time to look at implementing your suggestion in the near future ? |
For best out-of-the-box compatibility there should not be one default
ecdhCurve
for the tls client, OpenSSL should choose them automatically.I've had a lot of struggle connecting to a server that did not support the default curve. Many third party modules have no support for setting
ecdhCurve
, therefore I think the tls client should support as much curves as possible by default. Using'auto'
would achieve this.Refs: #16196
Refs: #1495
Refs: https://wiki.openssl.org/index.php/Manual:SSL_CTX_set1_curves(3)
Refs: #15206
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
tls