Skip to content

Unable to run codeceptjs with nodejs version 18.8.0 on a FIPS mode enabled kernel system. #3973

@nghiado

Description

@nghiado

What are you trying to achieve?

Run CodeceptJS with NodeJS 18.18.0 on a FIPS mode enabled kernel system.

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

12:26:14  > ./node_modules/.bin/codeceptjs run --verbose --steps --reporter mocha-multi --grep @setup|@ftux
12:26:14  
12:26:15  Error: error:0308010C:digital envelope routines::unsupported
12:26:15      at new Hash (node:internal/crypto/hash:69:19)
12:26:15      at Object.createHash (node:crypto:133:10)
12:26:15      at module.exports.genTestId (/usr/src/app/node_modules/codeceptjs/lib/utils.js:14:28)
12:26:15      at /usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:50:22
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:427:14)
12:26:15      at /usr/src/app/node_modules/mocha/lib/suite.js:429:11
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:428:15)
12:26:15      at mocha.loadFiles (/usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:49:21)
12:26:15  
12:26:15  error:0308010C:digital envelope routines::unsupported
12:26:15  
12:26:15  Error: 
12:26:15      at new Hash (node:internal/crypto/hash:69:19)
12:26:15      at Object.createHash (node:crypto:133:10)
12:26:15      at module.exports.genTestId (/usr/src/app/node_modules/codeceptjs/lib/utils.js:14:28)
12:26:15      at /usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:50:22
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:427:14)
12:26:15      at /usr/src/app/node_modules/mocha/lib/suite.js:429:11
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:428:15)
12:26:15      at mocha.loadFiles (/usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:49:21)
12:26:15  [Pipeline] echo

Details

  • CodeceptJS version: 3.4.1
  • NodeJS Version: 18.18.0
  • Operating System: Linux (amd64/amazonlinux:2023)
  • Puppeteer 18.0.0

NodeJS 18.18.0 include a FIPS related change that seems likely to be the cause of this issues: https://github.com/nodejs/node/pull/48392/files
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.18.0

the change in NodeJS 18.18.0 appears to essentially enable fips support in nodejs, and it then exposes codeceptjs attempting to use md5: https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/utils.js#L14

[utils.js](https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/utils.js)
  return require('crypto').createHash('md5').update(test.fullTitle()).digest('base64')

replacing md5 with sha256 does appear to allow this to run, so we need some help to update codeceptjs library utils.js to allow running codecepjs on a FIPS mode enabled kernel system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions