isaacs/npm — Issue #2235: Cannot connect to registry.npmjs.org
Author: fsateler
Created: 2012-03-07 12:11:34+00:00
State: open

```
felipe@pcfelipe:~% npm install --verbose ejs
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli '/usr/bin/npm',
npm verb cli 'install',
npm verb cli '--verbose',
npm verb cli 'ejs' ]
npm info using npm@1.1.4
npm info using node@v0.6.11
npm verb config file /home/felipe/.npmrc
npm verb config file /usr/etc/npmrc
npm verb config file /usr/share/npm/npmrc
npm verb cache add [ 'ejs', null ]
npm verb parsed url { pathname: 'ejs',
npm verb parsed url path: 'ejs',
npm verb parsed url href: 'ejs' }
npm verb addNamed [ 'ejs', '' ]
npm verb addNamed [ null, '' ]
npm verb raw, before any munging ejs
npm verb url resolving [ 'https://registry.npmjs.org/', './ejs' ]
npm verb url resolved https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/ejs

npm ERR! Error: failed to fetch from registry: ejs
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:108:22)
npm ERR! at Request. (/usr/lib/nodejs/request/main.js:191:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:343:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Linux 3.2.0-1-amd64
npm ERR! command "node" "/usr/bin/npm" "install" "--verbose" "ejs"
npm ERR! cwd /home/felipe
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: ejs
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/felipe/npm-debug.log
npm not ok

felipe@pcfelipe:~% npm config get ca
-----BEGIN CERTIFICATE-----
MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x
IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w
bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y
MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV
BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj
YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA
aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE
OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz
Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl
y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC
l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv
yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl
ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op
-----END CERTIFICATE-----
```

At first I thought it was a problem with the CA cert, but it seems that it is not:

```
felipe@pcfelipe:~% npm config get ca > ca.pem
felipe@pcfelipe:~% openssl s_client -CAfile ca.pem -connect registry.npmjs.org:443 -verify 1
verify depth is 1
CONNECTED(00000003)
depth=1 C = US, ST = CA, L = Oakland, O = npm, OU = npm Certificate Authority, CN = npmCA, emailAddress = i@izs.me
verify return:1
depth=0 C = US, ST = CA, L = Oakland, O = npm, OU = registry, CN = registry.npmjs.org, emailAddress = i@izs.me
verify return:1
---
Certificate chain
0 s:/C=US/ST=CA/L=Oakland/O=npm/OU=registry/CN=registry.npmjs.org/emailAddress=i@izs.me
i:/C=US/ST=CA/L=Oakland/O=npm/OU=npm Certificate Authority/CN=npmCA/emailAddress=i@izs.me
1 s:/C=US/ST=CA/L=Oakland/O=npm/OU=npm Certificate Authority/CN=npmCA/emailAddress=i@izs.me
i:/C=US/ST=CA/L=Oakland/O=npm/OU=npm Certificate Authority/CN=npmCA/emailAddress=i@izs.me
---
Server certificate
-----BEGIN CERTIFICATE-----
MIICPzCCAagCCQCfeUuTLMk3XDANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x
IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w
bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y
MTA5MDIwMTQ3MTdaMIGDMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV
BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTERMA8GA1UECxMIcmVnaXN0cnkxGzAZ
BgNVBAMTEnJlZ2lzdHJ5Lm5wbWpzLm9yZzEXMBUGCSqGSIb3DQEJARYIaUBpenMu
bWUwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAs962+2Q8kYlBLgOZ2tc0T/XMjH6N
KLmq06q0WN+Qjbi08qpg7V60IFqDeKFa9jAR7yP/6ixEqOJ3sYErn30UrwIDAQAB
MA0GCSqGSIb3DQEBBQUAA4GBAJXV5fsiulgzCtSCZo0vuds14n5D5wVcpG4cfPlf
C2QXE2x28hehp/+WLqd5plxg0Oti42Xna/PkJpYh1rtpfVuH6c2Nd7tcgXSL1Gyu
tMYmBxi52T8uVOzKzr/aR9n94HijTV2QgejGXfR5Eim4+0xZbNF2z7vuBT7I47tu
nlJO
-----END CERTIFICATE-----
subject=/C=US/ST=CA/L=Oakland/O=npm/OU=registry/CN=registry.npmjs.org/emailAddress=i@izs.me
issuer=/C=US/ST=CA/L=Oakland/O=npm/OU=npm Certificate Authority/CN=npmCA/emailAddress=i@izs.me
---
No client certificate CA names sent
---
SSL handshake has read 1757 bytes and written 353 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 512 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : SSLv3
Cipher : DHE-RSA-AES256-SHA
Session-ID: B662A6FB0A7E7893815596C73216C26A2748529F3484B6746F26F986022FAFEB
Session-ID-ctx:
Master-Key: 0ED9C98BA5FDDD594C73201514BA3F403BB4D03DA1C0CCD3EE7CD0B28586B31BEBE75F71F533057B1F05F4AB877199C7
Key-Arg : None
PSK identity: None
PSK identity hint: None
Start Time: 1331121618
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
HTTP/1.0 408 Timeout
Content-Type: text/html
Content-Length: 80

Request timeout

Request timeout

closed
```

What could be causing this?