From 9204a0db6ed9fa309860031114feeebab7de4f07 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 17 Mar 2018 05:41:41 +0100 Subject: [PATCH] tls: runtime-deprecate tls.convertNPNProtocols() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/14602 PR-URL: https://github.com/nodejs/node/pull/19403 Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- doc/api/deprecations.md | 8 ++++++++ lib/tls.js | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index d8345c84b9ba4e..bca2558336afd0 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -971,6 +971,14 @@ initialization vectors. It is recommended to derive a key using [`crypto.createDecipheriv()`][] to obtain the [`Cipher`][] and [`Decipher`][] objects respectively. + +### 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 diff --git a/lib/tls.js b/lib/tls.js index 5d7999f1fb61ad..bc03a3ab15fb07 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -73,7 +73,7 @@ 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); @@ -81,7 +81,7 @@ exports.convertNPNProtocols = function(protocols, out) { // 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