Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

npm fails behind a proxy since node 0.8.4 #2719

Closed
jazzzz opened this Issue · 3 comments

2 participants

Jazz Eduard Gotwig
Jazz

Since node 0.8.4 I cannot use npm behind a proxy.
I tried using older versions of node/npm to see when it happened:

  • node 0.8.3 + npm 1.1.43: OK
  • node 0.8.4. + npm 1.1.45: broken
  • node 0.8.4. + npm 1.1.43: broken
  • node 0.8.3 + npm 1.1.45: OK

Some logs:

jazz:/tmp % npm install npm -ddd
npm info it worked if it ends with ok
npm verb cli [ 'nodejs', '/usr/bin/npm', 'install', 'npm', '-ddd' ]
npm info using npm@1.1.44
npm info using node@v0.8.6
npm verb config file /home/jazz/.npmrc
npm verb config file /usr/etc/npmrc
npm verb config file /usr/lib/nodejs/npm/npmrc
npm verb read json /tmp/package.json
npm verb read json /tmp/package.json
npm verb cache add [ 'npm', null ]
npm sill cache add name=undefined spec="npm" args=["npm",null]
npm verb parsed url { pathname: 'npm', path: 'npm', href: 'npm' }
npm sill lockFile 660051d1-npm npm
npm verb lock npm /home/jazz/.npm/660051d1-npm.lock
npm sill lockFile 660051d1-npm npm
npm verb addNamed [ 'npm', '' ]
npm verb addNamed [ null, '' ]
npm sill lockFile 2f990b75-npm npm@
npm verb lock npm@ /home/jazz/.npm/2f990b75-npm.lock
npm sill addNameRange { name: 'npm', range: '', hasData: false }
npm verb url raw npm
npm verb url resolving [ 'https://registry.npmjs.org/', './npm' ]
npm verb url resolved https://registry.npmjs.org/npm
npm info retry registry request attempt 1 at 11:19:45
npm http GET https://registry.npmjs.org/npm
npm info retry will retry, error on last attempt: Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm info retry registry request attempt 2 at 11:19:56
npm http GET https://registry.npmjs.org/npm
npm info retry will retry, error on last attempt: Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm info retry registry request attempt 3 at 11:20:57
npm http GET https://registry.npmjs.org/npm
npm sill lockFile 2f990b75-npm npm@
npm ERR! Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/npm/node_modules/request/main.js:440:26)
npm ERR!     at ClientRequest.g (events.js:185:14)
npm ERR!     at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1455:7)
npm ERR!     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR!     at CleartextStream.socketOnData [as ondata] (http.js:1366:20)
npm ERR!     at CleartextStream.CryptoStream._push (tls.js:485:27)
npm ERR!     at SecurePair.cycle (tls.js:839:20)
npm ERR!     at EncryptedStream.CryptoStream.write (tls.js:220:13)
npm ERR!     at Socket.ondata (stream.js:38:26)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.0.0-16-server
npm ERR! command "nodejs" "/usr/bin/npm" "install" "npm" "-ddd"
npm ERR! cwd /tmp
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.44
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/npm-debug.log
npm ERR! not ok code 0
jazz:/tmp % npm install https://github.com/isaacs/npm/tarball/master -ddd
npm info it worked if it ends with ok
npm verb cli [ 'nodejs',
npm verb cli   '/usr/bin/npm',
npm verb cli   'install',
npm verb cli   'https://github.com/isaacs/npm/tarball/master',
npm verb cli   '-ddd' ]
npm info using npm@1.1.44
npm info using node@v0.8.6
npm verb config file /home/jazz/.npmrc
npm verb config file /usr/etc/npmrc
npm verb config file /usr/lib/nodejs/npm/npmrc
npm verb read json /tmp/package.json
npm verb read json /tmp/package.json
npm verb cache add [ 'https://github.com/isaacs/npm/tarball/master', null ]
npm sill cache add name=undefined spec="https://github.com/isaacs/npm/tarball/master" args=["https://github.com/isaacs/npm/tarball/master",null]
npm verb parsed url { protocol: 'https:',
npm verb parsed url   slashes: true,
npm verb parsed url   host: 'github.com',
npm verb parsed url   hostname: 'github.com',
npm verb parsed url   href: 'https://github.com/isaacs/npm/tarball/master',
npm verb parsed url   pathname: '/isaacs/npm/tarball/master',
npm verb parsed url   path: '/isaacs/npm/tarball/master' }
npm sill lockFile fdee66ea-ub-com-isaacs-npm-tarball-master https://github.com/isaacs/npm/tarball/master
npm verb lock https://github.com/isaacs/npm/tarball/master /home/jazz/.npm/fdee66ea-ub-com-isaacs-npm-tarball-master.lock
npm verb addRemoteTarball [ 'https://github.com/isaacs/npm/tarball/master', null ]
npm info retry fetch attempt 1 at 11:16:10
npm verb fetch to= /home/jazz/tmp/npm-29184/1344935770578-0.9763193030375987/tmp.tgz
npm http GET https://github.com/isaacs/npm/tarball/master
npm ERR! fetch failed https://github.com/isaacs/npm/tarball/master
npm info retry will retry, error on last attempt: Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm info retry fetch attempt 2 at 11:16:21
npm verb fetch to= /home/jazz/tmp/npm-29184/1344935770578-0.9763193030375987/tmp.tgz
npm http GET https://github.com/isaacs/npm/tarball/master
npm ERR! fetch failed https://github.com/isaacs/npm/tarball/master
npm info retry will retry, error on last attempt: Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm info retry fetch attempt 3 at 11:17:21
npm verb fetch to= /home/jazz/tmp/npm-29184/1344935770578-0.9763193030375987/tmp.tgz
npm http GET https://github.com/isaacs/npm/tarball/master
npm ERR! fetch failed https://github.com/isaacs/npm/tarball/master
npm sill lockFile fdee66ea-ub-com-isaacs-npm-tarball-master https://github.com/isaacs/npm/tarball/master
npm ERR! Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/npm/node_modules/request/main.js:440:26)
npm ERR!     at ClientRequest.g (events.js:185:14)
npm ERR!     at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR!     at HTTPParser.parserOnIncomingClient (http.js:1455:7)
npm ERR!     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR!     at CleartextStream.socketOnData (http.js:1366:20)
npm ERR!     at CleartextStream.CryptoStream._push (tls.js:485:27)
npm ERR!     at SecurePair.cycle (tls.js:839:20)
npm ERR!     at EncryptedStream.CryptoStream.write (tls.js:220:13)
npm ERR!     at Socket.ondata (stream.js:38:26)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.0.0-16-server
npm ERR! command "nodejs" "/usr/bin/npm" "install" "https://github.com/isaacs/npm/tarball/master" "-ddd"
npm ERR! cwd /tmp
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.44
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/npm-debug.log
npm ERR! not ok code 0
Jazz jazzzz closed this
Jazz jazzzz reopened this
Jazz

I can workaround this issue with npm config set strict-ssl false, but I think registry.npmjs.org certificate should be valid or at least accepted by default, and I don't see why the github certificate is rejected.

isaacs isaacs referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
isaacs isaacs referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
isaacs isaacs referenced this issue from a commit in isaacs/request
isaacs isaacs Pass servername to tunneling secure socket creation
This makes the https-over-http proxy work when strictSSL is turned on.

In v0.8.4, we fixed a bug where an otherwise valid cert would be
accepted for a host that was not listed in the CN or subjectaltnames
sections of the certificate.

However, this breaks proxying, because you want to accept the cert if
it comes from the origin server, not tested against the proxy's
hostname.

This fixes npm/npm#2719
3e11937
Eduard Gotwig

Fixed for me.

Jazz

Fixed for me too.

Jazz jazzzz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.