-
Notifications
You must be signed in to change notification settings - Fork 3k
Using the npm client with registry behind client certificates fails #7672
Comments
The configuration documentation is maybe not as explicit about this as it should be, but the way it works right now is how it's documented and intended to work – Because proxies are relatively common, @chrisdickinson contributed a patch (back when If you wanted to add support for |
Thanks for the great explanation @othiym23 ! Now I get the cert and key configurations to get picked up properly. However, I still have problems with the cert option not reaching the server. I get the error
Reading up on the request lib that is used in npm-registry-client, I find that request expects an object called "agent" that should contain the ssl certificate option. npm-registry-client tries to provide that through here https://github.com/npm/npm-registry-client/blob/88399fa1ebc5473125466ffa940c5b7df9e693bc/lib/initialize.js#L68. But from npm you send the option I suppose this is an issue for the npm-registry-client instead though. As it actually accepts the |
This stuff is fiendishly difficult to test, so things fall through the cracks sometimes. I'll take a look at your PR on |
Thanks for the superly awesome short feedback loop on this! Happy to help. :-) |
I'm trying to provide the NPM client with client certificates using the
key
andcert
options.This because I need to be able to connect to a local registry running sinopia, and the server has client certificate verification set up as outer protection.
However, I get this error even before NPM can make a connection to the sinopia server
Where my
.npmrc
config looks like this at the moment (I have also tried using the paths as well as different ways of inlining the certificates)I know that both cert and key are correct as I can connect to our server with them using stunnel or openssl.
I downloaded the npm repo to try to debug this. And after much digging I noticed that I can get this to work with a small change in the registry client. See pull request attached for details
Is this the correct way of handling this issue? Maybe this isn't even an issue and I just missed completely on how client certificates should be provided?
Cheers
The text was updated successfully, but these errors were encountered: