Skip to content

Commit 9204a0d

Browse files
committed
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>
1 parent 5bfbe5c commit 9204a0d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

doc/api/deprecations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,14 @@ initialization vectors. It is recommended to derive a key using
971971
[`crypto.createDecipheriv()`][] to obtain the [`Cipher`][] and [`Decipher`][]
972972
objects respectively.
973973
974+
<a id="DEP0107"></a>
975+
### DEP0107: tls.convertNPNProtocols()
976+
977+
Type: Runtime
978+
979+
This was an undocumented helper function not intended for use outside Node.js
980+
core and obsoleted by the removal of NPN (Next Protocol Negotiation) support.
981+
974982
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
975983
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
976984
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array

lib/tls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ function convertProtocols(protocols) {
7373
return buff;
7474
}
7575

76-
exports.convertNPNProtocols = function(protocols, out) {
76+
exports.convertNPNProtocols = internalUtil.deprecate(function(protocols, out) {
7777
// If protocols is Array - translate it into buffer
7878
if (Array.isArray(protocols)) {
7979
out.NPNProtocols = convertProtocols(protocols);
8080
} else if (isUint8Array(protocols)) {
8181
// Copy new buffer not to be modified by user.
8282
out.NPNProtocols = Buffer.from(protocols);
8383
}
84-
};
84+
}, 'tls.convertNPNProtocols() is deprecated.', 'DEP0107');
8585

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

0 commit comments

Comments
 (0)