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

Remove the need for passing NODE_TLS_REJECT_UNAUTHORIZED=0 when interacting with Spin environments #201

Merged
merged 3 commits into from
Jul 27, 2022

Conversation

pepicrft
Copy link
Contributor

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 the TLS validation when we interact with Spin environments.

How to test your changes?

Try to log out, log in, and dev the fixture app.

@pepicrft pepicrft requested review from isaacroldan, gonzaloriestra and a team July 26, 2022 16:30
@pepicrft pepicrft self-assigned this Jul 26, 2022
@pepicrft pepicrft requested review from shauns and removed request for a team July 26, 2022 16:30
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "yarn changeset add" to track your changes and include them in the next release CHANGELOG.

@pepicrft pepicrft force-pushed the https-spin branch 3 times, most recently from 5f0ce06 to 4b6a1bc Compare July 27, 2022 08:23
@pepicrft pepicrft merged commit 09c3538 into main Jul 27, 2022
@pepicrft pepicrft deleted the https-spin branch July 27, 2022 10:24
@shopify-shipit shopify-shipit bot temporarily deployed to production July 28, 2022 16:24 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants