Skip to content

Conversation

eagletmt
Copy link
Contributor

@eagletmt eagletmt commented Aug 2, 2023

Webpack 5 uses md4 hash function as default, but OpenSSL 3 doesn't support the legacy hash function and results in ERR_OSSL_EVP_UNSUPPORTED error.

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:144:18)
    at BulkUpdateDecorator.update (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:64:8)
    at NormalModule._initBuildHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:838:17)
    at handleParseResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:903:10)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:994:4
    at processResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:717:11)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:777:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Webpack added a new function xxhash64 and it will be used as default in future.
https://webpack.js.org/configuration/output/#outputhashfunction
So I chose this hash function.

Webpack 5 uses `md4` hash function as default, but OpenSSL 3 doesn't
support the legacy hash function and results in ERR_OSSL_EVP_UNSUPPORTED
error.

```
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:144:18)
    at BulkUpdateDecorator.update (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:64:8)
    at NormalModule._initBuildHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:838:17)
    at handleParseResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:903:10)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:994:4
    at processResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:717:11)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:777:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
```

Webpack added a new function `xxhash64` and it will be used as default
in future.
https://webpack.js.org/configuration/output/#outputhashfunction
So I chose this hash function.
@eagletmt eagletmt force-pushed the fix-webpack5-ossl3 branch from 31bbd3a to efdb4f4 Compare August 2, 2023 18:03
Copy link
Collaborator

@morishin morishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!👍

@morishin morishin merged commit b3d9db5 into bdash-app:master Aug 4, 2023
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

Successfully merging this pull request may close these issues.

2 participants