-
-
Notifications
You must be signed in to change notification settings - Fork 956
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
https option rejectUnauthorized is always set forcing node https module to ignore NODE_TLS_REJECT_UNAUTHORIZED #2149
Comments
Having multiple options to alter Node.js behavior is a bad idea. The only reasonable place to do so is the code. |
Well, if having multiple options for doing something is a good or a bad idea is a matter of opinion. In this case following your opinion is breaking best practice of many years for test environments. |
It's not best practice. |
It was certainly my expectation that Before I could get by a test environment running self signed certs by just setting the environment variable in CI and it would work reliably even with my other dependencies, some of which may be got 11, that are based on the node:http(s) modules. Now I need to add code that checks for the variable's value and changes I wish this change would be reconsidered, it is certainly unexpected. |
@szmarczak @sindresorhus This is causing some issues in |
@szmarczak Why All is working fine if I add |
Describe the bug
In source/core/options.ts the https option
rejectUnauthorized
is always set. If not to true or false then at least to undefined. But even if it is only set to undefined it is deactivating the consideration of environment variable NODE_TLS_REJECT_UNAUTHORIZED in the https module of Node.You can easily avoid this by changing line
got/source/core/options.ts
Line 2442 in 73501b6
to
Actual behavior
...
Expected behavior
...
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: