npm / minipass-fetch

An implementation of window.fetch in Node.js using Minipass streams
Other
54 stars 11 forks source link

Does not work via npm with NODE_EXTRA_CA_CERTS configured #109

Closed heuristicservices closed 1 year ago

heuristicservices commented 1 year ago

Is there an existing issue for this?

Current Behavior

I am running npm install, and my dependencies include a private github repo, configured via .npmrc as described.

I am on a corporate network that intercepts HTTPS traffic using a private CA, which I have configured as an environmental variable export NODE_EXTRA_CA_CERTS=/path/to/root_ca.pem.

I can't see that this is being picked up by minipass-fetch when it is run by npm, and installation fails with UNABLE_TO_GET_ISSUER_CERT_LOCALLY.

It would appear that some change could be made to pass through this extra certificate, if detected in the environment, similar to this PR: https://github.com/npm/minipass-fetch/pull/12/files

Expected Behavior

If NODE_EXTRA_CA_CERTS is configured, this should be used by minipass-fetch.

heuristicservices commented 1 year ago

I'm having a further look at this issue. It is perhaps not an issue with minipass-fetch will write an update.

heuristicservices commented 1 year ago

I added an up-to-date certificate bundle to .npmrc:

cafile=/private/etc/ssl/cert.pem

And added the extra certificate to my shell environment:

NODE_EXTRA_CA_CERTS=/Users/user/certs/root.ca.pem

And could not reproduce, closing.