node.js – How to really solve error:0308010C:digital envelope routines::unsupported in Node 17+?
There’s multiple questions about this, and all the answers recommend downgrading to Node 16 (unacceptable when so many packages these days require higher versions), or updating other packages like webpack.
But I’m getting this error without any packages at all. Simply trying to run this code in node command line (fresh LTS install of v22.11) fails:
const crypto = require('crypto')
const cipher = crypto.createDecipheriv('bf-ecb', 'key', null)
Error:
Uncaught Error: error:0308010C:digital envelope routines::unsupported
at Decipheriv.createCipherBase (node:internal/crypto/cipher:121:19)
at Decipheriv.createCipherWithIV (node:internal/crypto/cipher:133:3)
at new Decipheriv (node:internal/crypto/cipher:278:3)
at Object.createDecipheriv (node:crypto:147:10) {
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Is there any better solution than stuffing an environment variable everywhere? Why is it needed – does the new SSL provider not cover algorithms such as Blowfish?
Read more here: Source link
