cli
cli copied to clipboard
refactor: use nodejs env var for --insecure
Currently we're using global state and needle's rejectUnauthorized
option to setup insecure mode. rejectUnauthorized
is actually coming from the TLS module, needle just forwards it.
However, since Needle uses TLS module defaults, we can apply the same logic by using NodeJS's NODE_TLS_REJECT_UNAUTHORIZED env var.
https://nodejs.org/docs/latest/api/cli.html#node_tls_reject_unauthorizedvalue
The benefit is that we don't need to test it across multiple modules. This is a NodeJS feature which we can switch on globally. This also applies to any requests not going through our Needle wrapper so it's more thorough.
We have acceptance tests introduced by #3124
Warnings | |
---|---|
:warning: |
Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style
|
Generated by :no_entry_sign: dangerJS against 6312bd6baffd1c2553f84162e120b2e778c7f1f7
Closing as stale