From b913f6e59c2b7235190247fe58ad8644097ea1f5 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sun, 9 Nov 2025 21:43:07 +0000 Subject: [PATCH] tls: move _tls_* to end-of-life --- doc/api/deprecations.md | 5 ++++- lib/_tls_common.js | 10 ---------- lib/_tls_wrap.js | 11 ----------- lib/eslint.config_partial.mjs | 1 - lib/internal/main/mksnapshot.js | 2 -- src/node_builtins.cc | 4 ++-- test/parallel/test-internal-module-require.js | 2 -- test/parallel/test-process-get-builtin.mjs | 2 -- test/parallel/test-warn-tls-common-deprecation.js | 11 ----------- test/parallel/test-warn-tls-wrap-deprecation.js | 11 ----------- tsconfig.json | 2 -- 11 files changed, 6 insertions(+), 55 deletions(-) delete mode 100644 lib/_tls_common.js delete mode 100644 lib/_tls_wrap.js delete mode 100644 test/parallel/test-warn-tls-common-deprecation.js delete mode 100644 test/parallel/test-warn-tls-wrap-deprecation.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 78ff6d5222b006..d5ffb7cc630c52 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -4179,6 +4179,9 @@ npx codemod@latest @nodejs/repl-builtin-modules -Type: Runtime +Type: End-of-Life The `node:_tls_common` and `node:_tls_wrap` modules are deprecated as they should be considered an internal nodejs implementation rather than a public facing API, use `node:tls` instead. diff --git a/lib/_tls_common.js b/lib/_tls_common.js deleted file mode 100644 index cdbb40882204ec..00000000000000 --- a/lib/_tls_common.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -const { SecureContext, createSecureContext, translatePeerCertificate } = require('internal/tls/common'); -module.exports = { - SecureContext, - createSecureContext, - translatePeerCertificate, -}; -process.emitWarning('The _tls_common module is deprecated. Use `node:tls` instead.', - 'DeprecationWarning', 'DEP0192'); diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js deleted file mode 100644 index 910278e40a4f0e..00000000000000 --- a/lib/_tls_wrap.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const { TLSSocket, Server, createServer, connect } = require('internal/tls/wrap'); -module.exports = { - TLSSocket, - Server, - createServer, - connect, -}; -process.emitWarning('The _tls_wrap module is deprecated. Use `node:tls` instead.', - 'DeprecationWarning', 'DEP0192'); diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs index bb5b4d8cc7c980..313b8f6950bd6c 100644 --- a/lib/eslint.config_partial.mjs +++ b/lib/eslint.config_partial.mjs @@ -531,7 +531,6 @@ export default [ { files: [ 'lib/_http_*.js', - 'lib/_tls_*.js', 'lib/http.js', 'lib/http2.js', 'lib/internal/http.js', diff --git a/lib/internal/main/mksnapshot.js b/lib/internal/main/mksnapshot.js index b06b1a70bf4939..4f24f4de8855cc 100644 --- a/lib/internal/main/mksnapshot.js +++ b/lib/internal/main/mksnapshot.js @@ -48,8 +48,6 @@ const supportedModules = new SafeSet(new SafeArrayIterator([ '_stream_transform', '_stream_wrap', '_stream_writable', - // '_tls_common', - // '_tls_wrap', 'assert', 'assert/strict', // 'async_hooks', diff --git a/src/node_builtins.cc b/src/node_builtins.cc index 2a77bf6d7a4715..a01ba40ba29065 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -142,8 +142,8 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const { #endif // !NODE_USE_V8_PLATFORM || !defined(NODE_HAVE_I18N_SUPPORT) #if !HAVE_OPENSSL - "crypto", "crypto/promises", "https", "http2", "tls", "_tls_common", - "_tls_wrap", "internal/tls/parse-cert-string", "internal/tls/common", + "crypto", "crypto/promises", "https", "http2", "tls", + "internal/tls/parse-cert-string", "internal/tls/common", "internal/tls/wrap", "internal/tls/secure-context", "internal/http2/core", "internal/http2/compat", "internal/streams/lazy_transform", diff --git a/test/parallel/test-internal-module-require.js b/test/parallel/test-internal-module-require.js index 3605d98e5e27bc..19925c9eaac3f9 100644 --- a/test/parallel/test-internal-module-require.js +++ b/test/parallel/test-internal-module-require.js @@ -30,8 +30,6 @@ const expectedPublicModules = new Set([ '_stream_transform', '_stream_wrap', '_stream_writable', - '_tls_common', - '_tls_wrap', 'assert', 'async_hooks', 'buffer', diff --git a/test/parallel/test-process-get-builtin.mjs b/test/parallel/test-process-get-builtin.mjs index de863ff3597641..435d00ae26cda6 100644 --- a/test/parallel/test-process-get-builtin.mjs +++ b/test/parallel/test-process-get-builtin.mjs @@ -25,8 +25,6 @@ if (!isMainThread) { if (!hasCrypto) { publicBuiltins.delete('crypto'); publicBuiltins.delete('tls'); - publicBuiltins.delete('_tls_common'); - publicBuiltins.delete('_tls_wrap'); publicBuiltins.delete('http2'); publicBuiltins.delete('https'); publicBuiltins.delete('inspector'); diff --git a/test/parallel/test-warn-tls-common-deprecation.js b/test/parallel/test-warn-tls-common-deprecation.js deleted file mode 100644 index 00ce2690a95676..00000000000000 --- a/test/parallel/test-warn-tls-common-deprecation.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const common = require('../common'); -if (!common.hasCrypto) common.skip('missing crypto'); - -// _tls_common is deprecated. - -common.expectWarning('DeprecationWarning', - 'The _tls_common module is deprecated. Use `node:tls` instead.', 'DEP0192'); - -require('_tls_common'); diff --git a/test/parallel/test-warn-tls-wrap-deprecation.js b/test/parallel/test-warn-tls-wrap-deprecation.js deleted file mode 100644 index 53fc1e69830f99..00000000000000 --- a/test/parallel/test-warn-tls-wrap-deprecation.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const common = require('../common'); -if (!common.hasCrypto) common.skip('missing crypto'); - -// _tls_wrap is deprecated. - -common.expectWarning('DeprecationWarning', - 'The _tls_wrap module is deprecated. Use `node:tls` instead.', 'DEP0192'); - -require('_tls_wrap'); diff --git a/tsconfig.json b/tsconfig.json index 3f5a3067ced063..e6247becd7c763 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,8 +26,6 @@ "_stream_transform": ["./lib/_stream_transform.js"], "_stream_wrap": ["./lib/_stream_wrap.js"], "_stream_writable": ["./lib/_stream_writable.js"], - "_tls_common": ["./lib/_tls_common.js"], - "_tls_wrap": ["./lib/_tls_wrap.js"], "assert": ["./lib/assert.js"], "assert/strict": ["./lib/assert/strict.js"], "async_hooks": ["./lib/async_hooks.js"],