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

npm strict-ssl checking doesn't work #308

Closed
mlev opened this issue May 18, 2020 · 1 comment
Closed

npm strict-ssl checking doesn't work #308

mlev opened this issue May 18, 2020 · 1 comment
Labels

Comments

@mlev
Copy link
Contributor

mlev commented May 18, 2020

Versions

  • NodeJS: v12.16.3
  • mongodb-memory-server-*: 6.6.0
  • system: MacOS
  • npm: 6.14.4

package: mongo-memory-server

What is the Problem?

I was hitting this issue: #162 and saw that it should have been fixed in V6.6.0. But the fix to specify strict-ssl=false doesn't work for me on MacOS.

Do you know why it happens?

After a bit of digging the reasons seems to be (at least on MacOS):

  • The environment variable at runtime is named npm_config_strict_ssl not npm_config_strict-ssl as in the code.
  • When you specify --strict-ssl=false npm does not populate the variable as the string 'false'. It is an empty string. If you specify as true or omit it is set to 'true'.

NOTE: This appears like it could affect other places that pickup npm_config_* variables. e.g. npm_config_https-proxy

@mlev mlev added the bug label May 18, 2020
@mlev
Copy link
Contributor Author

mlev commented May 19, 2020

This doco also indicates that environment variables should use underscores:
https://docs.npmjs.com/misc/config#environment-variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant