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

[Feature Request]: If npm cafile setting exists, use it when downloading from unique ELECTRON_MIRROR #246

Open
3 tasks done
aarowman opened this issue Jun 1, 2023 · 0 comments
Labels
✨ enhancement New feature or request

Comments

@aarowman
Copy link

aarowman commented Jun 1, 2023

Preflight Checklist

Problem Description

Currently, when using a custom ELECTRON_MIRROR value, if the mirror repository requires a CA file, then Electron will not use a local CA by default. The user must set the NODE_EXTRA_CA_CERTS variable to get it added, since the Electron post install script for installing the binary uses node in the command, and is not an npm install.

Note that running npm on a CI system, the cafile location may not be known ahead of time (could be set on the CI runner system). The current workaround is to dynamically call npm config get cafile and assign the value into NODE_EXTRA_CA_CERTS

Proposed Solution

I think it would be helpful to automatically use the cafile value from .npmrc (npm config) when downloading a unique binary. Similar behavior was done in the cypress library (Cypress also downloads a binary with a zip using a post install and has a mirror environment variable).

See relevant code: https://github.com/search?q=repo%3Acypress-io%2Fcypress+getCa+%3D&type=code

Cypress docs for reference:

Alternatives Considered

The current workaround is to dynamically call npm config get cafile and assign the value into NODE_EXTRA_CA_CERTS, which does work.. but can be tedious in a CI system since it may be dynamic

Additional Information

No response

@codebytere codebytere transferred this issue from electron/electron Jun 7, 2023
@dsanders11 dsanders11 added the ✨ enhancement New feature or request label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants