Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tls: runtime-deprecate tls.convertNPNProtocols()
Fixes: #14602
PR-URL: #19403
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
bnoordhuis committed Mar 27, 2018
commit 9204a0db6ed9fa309860031114feeebab7de4f07
8 changes: 8 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,14 @@ initialization vectors. It is recommended to derive a key using
[`crypto.createDecipheriv()`][] to obtain the [`Cipher`][] and [`Decipher`][]
objects respectively.

<a id="DEP0107"></a>
### DEP0107: tls.convertNPNProtocols()

Type: Runtime

This was an undocumented helper function not intended for use outside Node.js
core and obsoleted by the removal of NPN (Next Protocol Negotiation) support.

[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
Expand Down
4 changes: 2 additions & 2 deletions lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ function convertProtocols(protocols) {
return buff;
}

exports.convertNPNProtocols = function(protocols, out) {
exports.convertNPNProtocols = internalUtil.deprecate(function(protocols, out) {
// 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.', 'DEP0107');

exports.convertALPNProtocols = function(protocols, out) {
// If protocols is Array - translate it into buffer
Expand Down