Skip to content

Commit eaadc90

Browse files
martinRenouibdafna
authored andcommitted
Fix OpenSSL issue
Signed-off-by: martinRenou <[email protected]>
1 parent 7bab2f3 commit eaadc90

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
},
115115
"jupyterlab": {
116116
"extension": "lib/plugin",
117+
"webpackConfig": "webpack.lab.config.js",
117118
"outputDir": "./ipydatagrid/labextension",
118119
"sharedPackages": {
119120
"@jupyter-widgets/base": {

webpack.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ const version = require('./package.json').version;
33

44
const luminoThemeImages = /^.*@lumino\/default-theme.*.png$/;
55

6+
const crypto = require('crypto');
7+
8+
// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
9+
const cryptoOrigCreateHash = crypto.createHash;
10+
crypto.createHash = (algorithm) =>
11+
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);
12+
13+
614
// Custom webpack rules
715
const rules = [
816
{ test: /\.ts$/, loader: 'ts-loader' },

webpack.lab.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const crypto = require('crypto');
2+
3+
// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
4+
const cryptoOrigCreateHash = crypto.createHash;
5+
crypto.createHash = (algorithm) =>
6+
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

0 commit comments

Comments
 (0)