Skip to content

Add End-of-Life deprecation on crypto.Credentials #20793

Description

@aduh95
  • Version: v11.0.0-nightly201805162b8cd93246
  • Platform: all
  • Subsystem: crypto

Back in v0.11.13 according to the docs, crypto.createCredentials and crypto.Credentials have been deprecated (DEP0010 and DEP0011) in favor of tls.createSecureContext . I am not familiar with these functions, but I am willing to bet it's been enough time since the deprecation to consider legitimately to move the deprecation to End-of-Life and talk about removing them.

I am raising this issue because of the warnings I got when I dynamically import the crypto module:

$ echo "import('crypto')" > ./test.mjs
$ node --experimental-modules --trace-warnings ./test.mjs
(node:30509) ExperimentalWarning: The ESM module loader is experimental.
    at startup (internal/bootstrap/node.js:115:17)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:577:3)
(node:30509) [DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.
    at createDynamicModule (internal/modules/esm/translators.js:71:48)
    at setExecutor (internal/modules/esm/create_dynamic_module.js:50:23)
    at node:crypto:11:5
    at ModuleJob.run (internal/modules/esm/module_job.js:106:14)
(node:30509) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
    at createDynamicModule (internal/modules/esm/translators.js:71:48)
    at setExecutor (internal/modules/esm/create_dynamic_module.js:50:23)
    at node:crypto:11:5
    at ModuleJob.run (internal/modules/esm/module_job.js:106:14)
(node:30509) [DEP0011] DeprecationWarning: crypto.Credentials is deprecated. Use tls.SecureContext instead.
    at createDynamicModule (internal/modules/esm/translators.js:71:48)
    at setExecutor (internal/modules/esm/create_dynamic_module.js:50:23)
    at node:crypto:11:5
    at ModuleJob.run (internal/modules/esm/module_job.js:106:14)

crypto.DEFAULT_ENCODING has been deprecated in Node 10, so one could argue it is too soon to break it. However, we might want to find a way to get rid of the deprecation warning before ES modules land without a flag ― core module raising warnings on load looks quite messy, I'd say.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.esmIssues and PRs related to the ECMAScript Modules implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions