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

RandomUuid.nextUuid use of md5 hash fails on FIPS enabled machine #804

Closed
jej2003 opened this issue Jul 27, 2024 · 1 comment · Fixed by #814
Closed

RandomUuid.nextUuid use of md5 hash fails on FIPS enabled machine #804

jej2003 opened this issue Jul 27, 2024 · 1 comment · Fixed by #814
Labels
enhancement New feature or request

Comments

@jej2003
Copy link

jej2003 commented Jul 27, 2024

I am trying to use testcontainers on a machine with FIPS enabled. When running I am getting the following error because of the use of the md5 hash on a FIPS enabled machine. The code is fairly straight forward and is incldued below for situational awareness.

error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
      24 |   }
      25 |
    > 26 |   mysqlContainer = await new GenericContainer('mysql:8.0.32')
         |                    ^
      27 |     .withEnvironment({
      28 |       MYSQL_ALLOW_EMPTY_PASSWORD: 'true',
      29 |       MYSQL_DATABASE: 'test',
      at hash (../node_modules/testcontainers/src/common/hash.ts:4:17)
      at RandomUuid.nextUuid (../node_modules/testcontainers/src/common/uuid.ts:10:16)
      at ../node_modules/testcontainers/src/reaper/reaper.ts:31:94
      at withFileLock (../node_modules/testcontainers/src/common/file-lock.ts:14:12)
      at getReaper (../node_modules/testcontainers/src/reaper/reaper.ts:29:12)
      at GenericContainer.start (../node_modules/testcontainers/src/generic-container/generic-container.ts:104:22)
      at Object.<anonymous> (src/service/service.test.ts:26:20)
  mysqlContainer = await new GenericContainer('mysql:8.0.32')
    .withEnvironment({
      MYSQL_ALLOW_EMPTY_PASSWORD: 'true',
      MYSQL_DATABASE: 'test',
    })
    .withExposedPorts(3306)
    .withStartupTimeout(500000)
    .start()

What is the recommended way to run testcontaienrs-node on a FIPS enabled machine?

@cristianrgreco
Copy link
Collaborator

There's no reason why we couldn't use a sha256 hash instead of md5, I'll raise a PR

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality labels Aug 5, 2024
@cristianrgreco cristianrgreco removed the minor Backward compatible functionality label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants