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

.npmrc 'cafile' option should be honored by binary postinstall #8825

Closed
bridzius opened this issue Oct 13, 2020 · 2 comments · Fixed by #8877
Closed

.npmrc 'cafile' option should be honored by binary postinstall #8825

bridzius opened this issue Oct 13, 2020 · 2 comments · Fixed by #8877
Labels
package manager: npm Issues relating to npm

Comments

@bridzius
Copy link

Current behavior

When developing, it is very convenient to have a repository-defined .npmrc file with all the custom options. We use self-signed certificates for the binary repository mirror which we have set via cypress_download_mirror in the .npmrc. We also have cafile set to our root certificate file and use that when running npm install and such.

When running npm install cypress - the https://github.com/cypress-io/cypress/blob/develop/cli/lib/tasks/download.js ignores the cafile configuration even if it exists and only takes the environment configuration.

A workaround is to set the NODE_EXTRA_CA_CERTS variable, but that is a global solution and we might have several separate cafiles for different projects.

Desired behavior

https://github.com/cypress-io/cypress/blob/develop/cli/lib/tasks/download.js should honor the cafile configuration and use the specified certificate if it is set in the .npmrc configuration when it is being run.

Test code to reproduce

Not easy to reproduce via a singular repo (requires self-signed certificates and registries). Will try to do it if needed.

@jennifer-shehane jennifer-shehane added the package manager: npm Issues relating to npm label Oct 15, 2020
minijus added a commit to minijus/cypress that referenced this issue Oct 17, 2020
@cypress-bot cypress-bot bot added the stage: work in progress There is an open PR for this issue [WIP] label Oct 17, 2020
minijus added a commit to minijus/cypress that referenced this issue Oct 18, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress There is an open PR for this issue [WIP] labels Nov 3, 2020
minijus added a commit to minijus/cypress that referenced this issue Apr 20, 2021
@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] and removed stage: needs review The PR code is done & tested, needs review labels May 6, 2021
minijus added a commit to minijus/cypress that referenced this issue May 10, 2021
Introduce new env variable `CYPRESS_DOWNLOAD_USE_CA`.
When set `cypress` post-install will respect `ca` and `cafile` properties set on npm config.

Closes cypress-io#8825
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress There is an open PR for this issue [WIP] labels May 10, 2021
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels May 10, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 10, 2021

The code for this is done in cypress-io/cypress#8877, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 10, 2021

Released in 7.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package manager: npm Issues relating to npm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants