Skip to content

Use npm's cafile config re #848#844

Closed
mschnee wants to merge 1 commit intonodejs:masterfrom
mschnee:master
Closed

Use npm's cafile config re #848#844
mschnee wants to merge 1 commit intonodejs:masterfrom
mschnee:master

Conversation

@mschnee
Copy link
Copy Markdown

@mschnee mschnee commented Dec 15, 2015

Do a google search for "UNABLE_TO_GET_ISSUER_CERT_LOCALLY" or "can't install behind corporate firewall" or "can't install behind proxy".

tl;dr I need to install a module, which requires something to be rebuilt, and it fails because node-gyp doesn't honor my npm configurations for cafiles (for corporate self-signed certificate).

Specifically, this addresses needing to download node's headers when an install/update requires a rebuild.

@bnoordhuis
Copy link
Copy Markdown
Member

Did you check if HEAD of master works? --cafile was recently added - it's the most recent commit in fact - and is inherited implicitly through the environment. See commit 8c4b0ff for details.

@mschnee
Copy link
Copy Markdown
Author

mschnee commented Dec 16, 2015

I intend to double-check tomorrow. The use-case was npm install ${somePackageRequiringARebuild}, with ca configured via npm config set cafile="/path/to/cert.pem", and invasive debugging of gyp.opts (e.g. console.log) showed that if (caFile)... was a false condition.

If this is the case, and the intention is that it should be inherited implicitly or explicitly into gyp.opts, then my 'fix' is in the wrong place. I will look into how gyp.opts is populated.

@bnoordhuis
Copy link
Copy Markdown
Member

Here is the code that is responsible for populating the gyp.opts object with npm_config_* environment variables.

@longtimeago
Copy link
Copy Markdown

@mschnee @bnoordhuis guys, any progress here? Is there any chance to bypass the issue without the PR?

@bnoordhuis
Copy link
Copy Markdown
Member

Closing, --cafile has been out for some time now and seems to be working okay. Please holler if you have reason to believe otherwise.

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.

3 participants