-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: remove NPN (next protocol negotation) support #19403
Conversation
doc/api/deprecations.md
Outdated
@@ -950,6 +950,13 @@ deprecated if the assigned value is not a string, boolean, or number. In the | |||
future, such assignment may result in a thrown error. Please convert the | |||
property to a string before assigning it to `process.env`. | |||
|
|||
<a id="DEP0105"></a> |
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.
A nit: DEP0105
-> DEP00XX
?
doc/api/tls.md
Outdated
|
||
When ALPN has no selected protocol, `tlsSocket.alpnProtocol` returns `false`. | ||
The `tlsSocket.alpnProtocol` property is a string that contains the selected | ||
ALPN protocol. When ALPN has no selected protocol, `tlsSocket.alpnProtocol` |
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.
A nit: excess space in protocol. When
@nodejs/crypto Can I get a review, please? @nodejs/tsc You should probably also weigh in, if not on the exact implementation than at least on the overall direction. See discussion in #14602 for rationale on expediting this. |
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.
Mostly LGTM, I personally cannot estimate the impact of ALPN/NPN support, but the linked issue seems to have discussed that already.
doc/api/deprecations.md
Outdated
|
||
Type: Runtime | ||
|
||
This was never a documented feature. |
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.
Nit: It would be great if you could add a sentence explaining why we decided to remove the API instead of documenting it.
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.
Agree. NPN is a documented feature making this comment a bit confusing.
No comments on the implementation, but on overall concept, SGTM. |
doc/api/deprecations.md
Outdated
<a id="DEP0105"></a> | ||
### DEP0105: tls.convertNPNProtocols() | ||
|
||
Type: Runtime |
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.
If the capability is being removed entirely, this should be Nevermind, I see that this specific function is retained for the time being.Type: End-of-Life
lib/tls.js
Outdated
// If protocols is Array - translate it into buffer | ||
if (Array.isArray(protocols)) { | ||
out.NPNProtocols = convertProtocols(protocols); | ||
} else if (isUint8Array(protocols)) { | ||
// Copy new buffer not to be modified by user. | ||
out.NPNProtocols = Buffer.from(protocols); | ||
} | ||
}; | ||
}, 'tls.convertNPNProtocols() is deprecated.', 'DEP0105'); |
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.
s/DEP0105/DEP00XX ... the code is to be assigned when the PR is landed.
Incorporated feedback. CI: https://ci.nodejs.org/job/node-test-pull-request/13877/ |
With mkssldef tweak: https://ci.nodejs.org/job/node-test-pull-request/13884/ |
NPN has been superseded by ALPN. Chrome and Firefox removed support for NPN in 2016 and 2017 respectively to no ill effect. Fixes: nodejs#14602 PR-URL: nodejs#19403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Fixes: nodejs#14602 PR-URL: nodejs#19403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Landed in b3f2391...9204a0d. |
NPN has been superseded by ALPN. Chrome and Firefox removed support for
NPN in 2016 and 2017 respectively to no ill effect.
Fixes: #14602
cc @nodejs/crypto