[solved] SSL certificate problem: Invalid certificate chain


#1

Sorry to be a bother, but …

$ npm -v
1.4.23
$ node -v
v0.10.30

Atom: 0.123.0

Trying to install a package (editorconfig):

npm http GET https://registry.npmjs.org/editorconfig
npm http GET https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/editorconfig
npm http 304 https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/mixto
npm http GET https://registry.npmjs.org/underscore-plus
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/property-accessors
npm http GET https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/property-accessors
npm ERR! git clone https://github.com/Benvie/harmony-collections.git Cloning into bare repository '/Volumes/storage/Users/mhulse/.atom/.node-gyp/.atom/.apm/_git-remotes/https-github-com-Benvie-harmony-collections-git-df214100'...
npm ERR! git clone https://github.com/Benvie/harmony-collections.git fatal: unable to access 'https://github.com/Benvie/harmony-collections.git/': SSL certificate problem: Invalid certificate chain
npm ERR! Error: Command failed: Cloning into bare repository '/Volumes/storage/Users/mhulse/.atom/.node-gyp/.atom/.apm/_git-remotes/https-github-com-Benvie-harmony-collections-git-df214100'...
npm ERR! fatal: unable to access 'https://github.com/Benvie/harmony-collections.git/': SSL certificate problem: Invalid certificate chain
npm ERR! 
npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)
npm ERR!     at ChildProcess.EventEmitter.emit (events.js:98:17)
npm ERR!     at maybeClose (child_process.js:743:16)
npm ERR!     at Socket.<anonymous> (child_process.js:956:11)
npm ERR!     at Socket.EventEmitter.emit (events.js:95:17)
npm ERR!     at Pipe.close (net.js:465:12)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/.apmrc" "--userconfig" "/Volumes/storage/Users/mhulse/.atom/.apmrc" "install" "/Volumes/storage/Users/mhulse/.atom/.node-gyp/.atom/.apm/editorconfig/0.2.0/package.tgz" "--target=0.11.13" "--arch=x64"
npm ERR! cwd /private/var/folders/wk/20bl4l_x4zzd_sg5j71r6t_40000gn/T/apm-install-dir-114716-1817-17h3gos
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code 128
npm http GET https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/mixto
npm http 304 https://registry.npmjs.org/underscore-plus
npm http 304 https://registry.npmjs.org/keypress
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /private/var/folders/wk/20bl4l_x4zzd_sg5j71r6t_40000gn/T/apm-install-dir-114716-1817-17h3gos/npm-debug.log
npm ERR! not ok code 0

I’ve checked my certs, and I don’t see any expired ones.

Apparently, the problem must just be on my computer as others I have talked to do not have any issues.

Interestingly, I can git clone https://github.com/Benvie/harmony-collections.git directly without any issues.

I’m not sure how to fix. Any tips?


#2

This is strange …

All of these work without any problems:

$ npm install harmony-collections
harmony-collections@0.3.8 node_modules/harmony-collections

$ git clone https://github.com/Benvie/harmony-collections.git
Cloning into 'harmony-collections'...
remote: Counting objects: 449, done.
remote: Total 449 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (449/449), 602.00 KiB | 80.00 KiB/s, done.
Resolving deltas: 100% (220/220), done.
Checking connectivity... done.

$ npm install git+https://git@github.com/Benvie/harmony-collections.git
harmony-collections@0.3.7 node_modules/harmony-collections

I’ve checked the cert that’s found here: https://registry.npmjs.org, and all looks good in my Keychain.

What certificates does APM need? Why would NPM work and not APM?


#3

What command are you using to install the editorconfig package?


#4

Hi @leedohm, thanks so much for the reply, I really appreciate it.

What command are you using to install the editorconfig package?

I’ve tried installing the package via Atom interface and via $ apm install editorconfig; both end up giving me the same results.

$ apm install editorconfig
Installing editorconfig to /Volumes/storage/Users/mhulse/.atom/packages ✗

npm http GET https://registry.npmjs.org/editorconfig
npm http GET https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/editorconfig
npm http GET https://registry.npmjs.org/mixto
npm http GET https://registry.npmjs.org/property-accessors
npm http GET https://registry.npmjs.org/underscore-plus
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/mixto
npm http 304 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/keypress
npm ERR! git clone https://github.com/Benvie/harmony-collections.git Cloning into bare repository '/Volumes/storage/Users/mhulse/.atom/.node-gyp/.atom/.apm/_git-remotes/https-github-com-Benvie-harmony-collections-git-df214100'...
npm ERR! git clone https://github.com/Benvie/harmony-collections.git fatal: unable to access 'https://github.com/Benvie/harmony-collections.git/': SSL certificate problem: Invalid certificate chain
npm ERR! Error: Command failed: Cloning into bare repository '/Volumes/storage/Users/mhulse/.atom/.node-gyp/.atom/.apm/_git-remotes/https-github-com-Benvie-harmony-collections-git-df214100'...
npm ERR! fatal: unable to access 'https://github.com/Benvie/harmony-collections.git/': SSL certificate problem: Invalid certificate chain
npm ERR! 
npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)
npm ERR!     at ChildProcess.EventEmitter.emit (events.js:98:17)
npm ERR!     at maybeClose (child_process.js:743:16)
npm ERR!     at Socket.<anonymous> (child_process.js:956:11)
npm ERR!     at Socket.EventEmitter.emit (events.js:95:17)
npm ERR!     at Pipe.close (net.js:465:12)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/.apmrc" "--userconfig" "/Volumes/storage/Users/mhulse/.atom/.apmrc" "install" "/Volumes/storage/Users/mhulse/.atom/.node-gyp/.atom/.apm/editorconfig/0.2.0/package.tgz" "--target=0.11.13" "--arch=x64"
npm ERR! cwd /private/var/folders/wk/20bl4l_x4zzd_sg5j71r6t_40000gn/T/apm-install-dir-114718-4345-c0cbeh
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code 128
npm http 304 https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/underscore-plus
npm http 304 https://registry.npmjs.org/property-accessors
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /private/var/folders/wk/20bl4l_x4zzd_sg5j71r6t_40000gn/T/apm-install-dir-114718-4345-c0cbeh/npm-debug.log
npm ERR! not ok code 0

I’ve even re-installed npm a few times (FYI, I’ve installed node using Homebrew (which comes with npm)).

Here’s some details on versions:

$ npm -v
1.4.23

$ apm -v
apm  0.91.0
npm  1.4.4
node 0.10.26
python 2.7.8
git 1.8.5.2

$ node -v
v0.10.30

Also note …

I was just able to install these packages, via Atom, without any problems:

  1. Zen
  2. Color Picker
  3. Editor Stats

Strange. How the heck do I track down what certificate is, or isn’t, causing me problems?

I hate to waste anyone’s time here … Do you think I should move my question to StackOverflow?


#5

You’re not wasting anyone’s time. We’re here because we want to share information and help each other out. Or at least I am :grinning: I do try to check StackOverflow occasionally and do the same there, but I like the discussion format here better … and I think it is better for this kind of back-and-forth exchange of information and diagnosis. (Of course, this is just my opinion and I’m sure there are others that have differing ones.)

Now, you might want to file a bug on the editorconfig repository. I notice that it depends on a couple npm packages and with the update to new versions of Chromium and such in the last couple versions, something there might not be compatible.

@thomasjo, do you still have the editorconfig package installed? I know you did at one point in time.


#6

Thanks again for the reply and help @leedohm!

I’ll head on over to editorconfig repo to get further help.

Oddly enough, I just got on my work machine and was able to install editorconfig without a problem.

It must be something specific to my laptop.

I’m going to compare certificates between my work computer and my laptop. I’m hoping that I’ll find a missing cert … Also hoping that installing assumed missing cert will solve my problems. :smile:

I’ll post back my results. Thanks again for your help!!!


#7

I’m going to compare certificates between my work computer and my
laptop. I’m hoping that I’ll find a missing cert … Also hoping that
installing assumed missing cert will solve my problems.

I noticed that my Mac Laptop (the one with the cert issue), when compared to my desktop computer, was missing a DigiCert High Assurance CA-3 (though, it had a “root” version). I tried re-installing this cert without any success.

Long story short, I ended up re-installing (dirty install) OS X Mavericks and that fixed it! I was then able to install editorconfig, via Atom, without any issues.

Well, I’m not sure what changed (nothing obviously different/new in my kyechain), but I’m happy to be moving on with things. Thanks so much for your help @leedohm, I owe you several Oregon micro/home brews!!! :beers: :smile:

Have an excellent day!


#8

I’m glad to hear you got it fixed! Happy coding! :beers:


#9

In case someone does not want to reinstall the whole OS… What worked for me is opening the Keychain.app and copying all Digicert Root Certificates into the System keychain.