registry.npmjs.org ssl certificate error


(Georgexsh) #1

full message is:

error An unexpected error occurred: "https://registry.npmjs.org/address/-/address-1.0.3.tgz: Hostname/IP doesn’t match certificate’s altnames: “Host: registry.npmjs.org. is not in the cert’s altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net\””.

this issue is not 100% reproducible on my side.
I guess is there a something wrong with fastly CDN?

related posts:



webpack using npm: ERR! code ERR_TLS_CERT_ALTNAME_INVALID
(Stradivario) #2

Having the same issue from today.

Before 6 hours i was not having this problem.

Also now the npm registry is down and i cannot install any package!


(Stradivario) #3

Here what it says when i try to login

https://registry.npmjs.org/-/v1/login

npm verb web login before first POST
npm http request → POST https://registry.npmjs.org/-/v1/login
npm http 500 ← Internal Server Error (https://registry.npmjs.org/-/v1/login)
npm verb web login not supported, trying couch
Username:

(Anis Marrouchi) #4

I confirm having the same problem when runnning npm install and npm audit fix. The error that I receive is:
$ sudo npm i -g npm@latest
npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! request to https://registry.npmjs.org/npm failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net


(Cedric Van Putten) #5

I can confirm I have the exact same error as @anis-marrouchi. I’m using Google’s Public DNS service and I’m located in Amsterdam (maybe that can help in reproducing the issue).

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.9.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'npm@latest' ]
2 info using npm@6.4.1
3 info using node@v10.9.0
4 verbose npm-session abb1a104e5601559
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for npm@latest request to https://registry.npmjs.org/npm failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net
8 timing stage:rollbackFailedOptional Completed in 2ms
9 timing stage:runTopLevelLifecycles Completed in 1273ms
10 verbose type system
11 verbose stack FetchError: request to https://registry.npmjs.org/npm failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net
11 verbose stack     at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
11 verbose stack     at ClientRequest.emit (events.js:182:13)
11 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:391:9)
11 verbose stack     at TLSSocket.emit (events.js:182:13)
11 verbose stack     at emitErrorNT (internal/streams/destroy.js:82:8)
11 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
11 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
12 verbose cwd /Users/cedric/Projects/bycedric/semantic-release-expo
13 verbose Darwin 17.7.0
14 verbose argv "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/bin/npm" "install" "-g" "npm@latest"
15 verbose node v10.9.0
16 verbose npm  v6.4.1
17 error code ERR_TLS_CERT_ALTNAME_INVALID
18 error errno ERR_TLS_CERT_ALTNAME_INVALID
19 error request to https://registry.npmjs.org/npm failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net
20 verbose exit [ 1, true ]

(Anis Marrouchi) #6

I’ve just rerun the command @byCedric and it went thru, looks like the problem is resolved. Can you confirm?


(Cedric Van Putten) #7

Unfortunately not, also when wiping the DNS cache it still responds with that error. One thing I find weird is when accessing the page with Chrome it previously states the certificate issue too. That doesn’t happen anymore, it only triggers in CLI.


(Stradivario) #8

Nope it is not working…

npm ERR!     /home/rampage/.npm/_logs/2018-09-01T10_55_15_833Z-debug.log
rampage@rampage-ThinkStation-D20:~/Desktop/work/repos/private/@rxdi/graphql$ npm i
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning undefined: request to https://registry.npmjs.org/@rxdi%2fcore failed,reason: Hostname/IP doesn't match certificate's altnames: \"Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net\"
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN @gapi/playground@1.0.11 requires a peer of @rxdi/core@^0.0.146 but none is installed. You must install peer dependencies yourself.
npm WARN ts-jest@22.4.6 requires a peer of typescript@2.x but none is installed. You must install peer dependencies yourself.
npm WARN tslint-language-service@0.9.9 requires a peer of typescript@>= 2.3.1 < 3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/rampage/Desktop/work/repos/private/@rxdi/graphql/node_modules/.staging/fsevents-1422a892/node_modules/abbrev' -> '/home/rampage/Desktop/work/repos/private/@rxdi/graphql/node_modules/.staging/abbrev-2a37932e'

npm ERR! request to https://registry.npmjs.org/@rxdi/hapi/-/hapi-0.0.228.tgz failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rampage/.npm/_logs/2018-09-01T11_01_42_614Z-debug.log
rampage@rampage-ThinkStation-D20:~/Desktop/work/repos/private/@rxdi/graphql$ npm i -g npm
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning undefined: request to https://registry.npmjs.org/npm failed, reason: Hostname/IP doesn't match certificate's altnames: \"Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net\"
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
/home/rampage/.nvm/versions/node/v8.9.4/bin/npm -> /home/rampage/.nvm/versions/node/v8.9.4/lib/node_modules/npm/bin/npm-cli.js
/home/rampage/.nvm/versions/node/v8.9.4/bin/npx -> /home/rampage/.nvm/versions/node/v8.9.4/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.2.0
updated 1 package in 6.392s
rampage@rampage-ThinkStation-D20:~/Desktop/work/repos/private/@rxdi/graphql$ npm i
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning undefined: request to https://registry.npmjs.org/@rxdi%2fhapi failed,reason: Hostname/IP doesn't match certificate's altnames: \"Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net\"
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN @gapi/playground@1.0.11 requires a peer of @rxdi/core@^0.0.146 but none is installed. You must install peer dependencies yourself.
npm WARN ts-jest@22.4.6 requires a peer of typescript@2.x but none is installed. You must install peer dependencies yourself.
npm WARN tslint-language-service@0.9.9 requires a peer of typescript@>= 2.3.1 < 3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/rampage/Desktop/work/repos/private/@rxdi/graphql/node_modules/.staging/fsevents-1422a892/node_modules/abbrev' -> '/home/rampage/Desktop/work/repos/private/@rxdi/graphql/node_modules/.staging/abbrev-2a37932e'

npm ERR! request to https://registry.npmjs.org/@rxdi/hapi/-/hapi-0.0.228.tgz failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rampage/.npm/_logs/2018-09-01T11_03_14_172Z-debug.log
rampage@rampage-ThinkStation-D20:~/Desktop/work/repos/private/@rxdi/graphql$

(Brion Mario) #9

I’m still having the issue :frowning:


(practicewild) #10

same error :
0 info it worked if it ends with ok 1 verbose cli [ '/home/practicewild/.nvm/versions/node/v8.11.4/bin/node', 1 verbose cli '/home/practicewild/.nvm/versions/node/v8.11.4/bin/npm', 1 verbose cli 'install', 1 verbose cli 'npm' ] 2 info using npm@5.6.0 3 info using node@v8.11.4 4 verbose config Skipping project config: /home/practicewild/.npmrc. (matches userconfig) 5 verbose npm-session d0aee4ea6e1d535a 6 silly install loadCurrentTree 7 silly install readLocalPackageData 8 silly fetchPackageMetaData error for npm@latest request to https://registry.npmjs.org/npm failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net" 9 verbose type system 10 verbose stack FetchError: request to https://registry.npmjs.org/npm failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net" 10 verbose stack at ClientRequest.req.on.err (/home/practicewild/.nvm/versions/node/v8.11.4/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14) 10 verbose stack at emitOne (events.js:116:13) 10 verbose stack at ClientRequest.emit (events.js:211:7) 10 verbose stack at TLSSocket.socketErrorListener (_http_client.js:387:9) 10 verbose stack at emitOne (events.js:116:13) 10 verbose stack at TLSSocket.emit (events.js:211:7) 10 verbose stack at emitErrorNT (internal/streams/destroy.js:64:8) 10 verbose stack at _combinedTickCallback (internal/process/next_tick.js:138:11) 10 verbose stack at process._tickCallback (internal/process/next_tick.js:180:9) 11 verbose cwd /home/practicewild 12 verbose Linux 4.15.0-33-generic 13 verbose argv "/home/practicewild/.nvm/versions/node/v8.11.4/bin/node" "/home/practicewild/.nvm/versions/node/v8.11.4/bin/npm" "install" "npm" 14 verbose node v8.11.4 15 verbose npm v5.6.0 16 error request to https://registry.npmjs.org/npm failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net" 17 verbose exit [ 1, true ]


(Haggins) #11

How is it there’s no official statement and no official workaround?

Btw npm config set strict-ssl false also doesn’t help. Install then just hangs:

$ npm config set strict-ssl true
$ npm install web3 --save
[..................] / rollbackFailedOptional: verb npm-session xxxxxx

(Georgexsh) #12

this might helps:

npm config set ca ""

from https://stackoverflow.com/questions/9626990/receiving-error-error-ssl-error-self-signed-cert-in-chain-while-using-npm


(Haggins) #13

It didn’t change anything. Was even “null” before.


(Lewis Crichton) #14

Going to registry.npmjs.org reveals the issue.

Fastly error: unknown domain. Please check that this domain has been added to a service.


(Georgexsh) #15

now registry.npmjs.org returns 500:

error An unexpected error occurred: “http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz: Request failed “500 Internal Server Error””.


(Lewis Crichton) #16

You can temporarily set your registry to registry.yarnpkg.com if you badly need to install some packages

npm config set registry https://registry.yarnpkg.com/

Just remember to change it back after.

npm config set registry https://registry.npmjs.org/

Certain packages may fail to install under Yarn’s registry since some dependencies are only available on NPM.


(Haggins) #17

https://registry.yarnpkg.com/ Host not found :roll_eyes:


(Lewis Crichton) #18

Huh. I just got that error too, but after spamming npm i a couple times I got it to download some packages.


(zbigg) #19

I don’t think it’s a viable workaround:

dig registry.yarnpkg.org @1.1.1.1 -> NXDOMAIN

https://github.com/yarnpkg/yarn/issues/5891 - registry.yarnpkg.com seems to be deprecated.


(Lewis Crichton) #20

That’s why I said temporarily. But you are correct. registry.yarnpkg.com is being deprecated.