Remove the need for passing NODE_TLS_REJECT_UNAUTHORIZED=0 when interacting with Spin environments #201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves https://github.com/Shopify/shopify-cli-planning/issues/322
WHY are these changes introduced?
Spin stores the CA certificate for HTTPS connections in the local environment's keychain, and because Node doesn't use them, Shopifolks trying to use the CLI with Spin run into issues that they workaround by invoking the CLI with the
NODE_TLS_REJECT_UNAUTHORIZED=0
environment variable. That's not ideal because the environment variable applies to all the HTTP requests, including the non-Spin ones.WHAT is this pull request doing?
I'm taking an intermediate step towards the ideal solution (i.e. reading and using the certificates from the Keychain), which consists of using an
https.Agent
that has the right configuration to skip theTLS
validation when we interact with Spin environments.How to test your changes?
Try to log out, log in, and
dev
the fixture app.