Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] Digital envelope routines::unsupported #59

Closed
emidev98 opened this issue Apr 5, 2022 · 7 comments
Closed

[ERROR] Digital envelope routines::unsupported #59

emidev98 opened this issue Apr 5, 2022 · 7 comments

Comments

@emidev98
Copy link

emidev98 commented Apr 5, 2022

Hello, we have found that the library has breaking changes with node v17.
The reason why is explained in this webiste, but a tinny extract from the website says:

This error is because node.js 17 uses OpenSSL3, which has changed code for initialization context of md family (including md4), and this is a breaking change.

NPM/NodeJs:
image

Error:
image

Please let us know if more information is needed or if we can help on a different way

@junderw
Copy link
Member

junderw commented Apr 5, 2022

@motorina0 this sounds like fun...

@junderw
Copy link
Member

junderw commented Apr 5, 2022

It seems like the only way to "fix" this is to remove node based hashing and only use pure JS hashing.

Alternatively, we could also use WASM.

@junderw
Copy link
Member

junderw commented Apr 5, 2022

or actually this might be better fixed upstream: https://github.com/crypto-browserify/createHash

@junderw
Copy link
Member

junderw commented Apr 5, 2022

......? I looked at Node v17 API for createHash... it hasn't really changed...

Is it just that OpenSSL no longer supports ripemd160?

@emidev98
Copy link
Author

emidev98 commented Apr 5, 2022

@motorina0
Copy link
Member

@motorina0 this sounds like fun...

yes, but you are too fast. Do you ever sleep?

Just to summarize:

  • this is indeed caused by Node v17 upgrading to OpenSSL 3.0 (from OpenSSL 1.1.1). Reported also on other projects.
  • quick fixes:
    • either use the --openssl-legacy-provider flag (NODE_OPTIONS=--openssl-legacy-provider npm run test)
    • or, use directly the browser version (crypto.ts):
      • const createHash = require('create-hash/browser');
  • long term fix suggested here: [Breaking] Node v17 crypto removed ripemd160 browserify/createHash#29

@junderw
Copy link
Member

junderw commented Sep 25, 2022

Fixed in 3.1.0

@junderw junderw closed this as completed Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants