Я искал в сети уже пару часов и не нашел решения. Я даже пытался отключить брандмауэр Windows и Защитник Windows, чтобы проверить, не блокирует ли он исходящие HTTPS-запросы из командной строки.
У меня установлен Node / Npm на моей машине с Win10, и я пытался установить некоторыеузловые модули, но я продолжаю получать ошибку ECONNRESET . У меня также есть файл curl.exe в папке System32, который также не работает ни с какими HTTPS-ссылками, которые я пробовал.
>curl.exe --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
>node --version
v10.16.3
>npm --version
6.12.0
(ПРИМЕЧАНИЕ: изначально версия NPM была 6.3.x, подробности позже)
Когда я пытаюсь выполнить следующее, я получаю ошибки рукопожатия:
>curl.exe -vvv https://www.google.com
* Rebuilt URL to: https://www.google.com/
* Trying 172.217.25.4...
* TCP_NODELAY set
* Connected to www.google.com (172.217.25.4) port 443 (#0)
* schannel: SSL/TLS connection with www.google.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 179 bytes...
* schannel: sent initial handshake data: sent 179 bytes
* schannel: SSL/TLS connection with www.google.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with www.google.com port 443 (step 2/3)
* schannel: encrypted data got 2536
* schannel: encrypted data buffer: offset 2536 length 4096
* schannel: sending next handshake data: sending 93 bytes...
* schannel: SSL/TLS connection with www.google.com port 443 (step 2/3)
* schannel: failed to receive handshake, SSL/TLS connection failed
* Closing connection 0
* schannel: shutting down SSL/TLS connection with www.google.com port 443
* schannel: clear security context handle
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed
>curl.exe -vvv https://registry.npmjs.org
* Rebuilt URL to: https://registry.npmjs.org/
* Trying 104.16.27.35...
* TCP_NODELAY set
* Connected to registry.npmjs.org (104.16.27.35) port 443 (#0)
* schannel: SSL/TLS connection with registry.npmjs.org port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 183 bytes...
* schannel: sent initial handshake data: sent 183 bytes
* schannel: SSL/TLS connection with registry.npmjs.org port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with registry.npmjs.org port 443 (step 2/3)
* schannel: encrypted data got 3706
* schannel: encrypted data buffer: offset 3706 length 4096
* schannel: sending next handshake data: sending 93 bytes...
* schannel: SSL/TLS connection with registry.npmjs.org port 443 (step 2/3)
* schannel: failed to receive handshake, SSL/TLS connection failed
* Closing connection 0
* schannel: shutting down SSL/TLS connection with registry.npmjs.org port 443
* schannel: clear security context handle
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed
Но изменение HTTPS на HTTP работает ...
>curl.exe -vvv http://www.google.com
* Rebuilt URL to: http://www.google.com/
* Trying 172.217.24.68...
* TCP_NODELAY set
* Connected to www.google.com (172.217.24.68) port 80 (#0)
> GET / HTTP/1.1
> Host: www.google.com
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 19 Oct 2019 01:20:34 GMT
< Expires: -1
< Cache-Control: private, max-age=0
[RESPOSNE WAS TOO LONG TO INCLUDE IN POST, NO SENSE IN PASTING THE WHOLE THING]
Итак, как вы можете видеть, HTTPS выдает ошибки, но не HTTP. У меня нет настроенного прокси, у меня нет ограничений в сети, и я даже попытался отключить брандмауэр Windows и Защитник Windows. У меня Ubuntu WSL, Ubuntu VM (через vmware) на той же машине, и нет проблем с HTTPS на них.
Чтобы проверить это, я изменяю реестр npm с https на http
с регистрацией NPM, установленной на HTTPS
>npm install --global --production npm-windows-upgrade --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--global',
npm verb cli '--production',
npm verb cli 'npm-windows-upgrade',
npm verb cli '--verbose' ]
npm info using npm@6.12.0
npm info using node@v10.16.3
npm verb npm-session 8f54e2561f964acb
npm timing stage:rollbackFailedOptional Completed in 0ms
npm timing stage:runTopLevelLifecycles Completed in 115092ms
npm verb type system
npm verb stack FetchError: request to https://registry.npmjs.org/npm-windows-upgrade failed, reason: Client network socket disconnected before secure TLS connection was established
npm verb stack at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm verb stack at ClientRequest.emit (events.js:198:13)
npm verb stack at TLSSocket.socketErrorListener (_http_client.js:392:9)
npm verb stack at TLSSocket.emit (events.js:198:13)
npm verb stack at emitErrorNT (internal/streams/destroy.js:91:8)
npm verb stack at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
npm verb stack at process._tickCallback (internal/process/next_tick.js:63:19)
npm verb cwd C:\WINDOWS\system32
npm verb Windows_NT 10.0.18362
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "npm-windows-upgrade" "--verbose"
npm verb node v10.16.3
npm verb npm v6.12.0
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/npm-windows-upgrade failed, reason: Client network socket disconnected before secure TLS connection was established
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm verb exit [ 1, true ]
npm timing npm Completed in 116077ms
с регистрацией NPM, установленной в HTTP
>npm install --global --production npm-windows-upgrade --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--global',
npm verb cli '--production',
npm verb cli 'npm-windows-upgrade',
npm verb cli '--verbose' ]
npm info using npm@6.12.0
npm info using node@v10.16.3
npm verb npm-session 4cde14186baae336
npm http fetch GET 304 http://registry.npmjs.org/npm-windows-upgrade 451ms (from cache)
npm timing stage:loadCurrentTree Completed in 1439ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 20ms
npm http fetch GET 304 http://registry.npmjs.org/chalk 137ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/debug 139ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/commander 146ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/cli-spinner 154ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/inquirer 155ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/prompt 446ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/escape-string-regexp 36ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/supports-color 117ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/ansi-styles 139ms (from cache)
Как вы можете видеть сверху, не проблема, если его HTTP. Я помню, что HTTPS работал несколько месяцев назад, поэтому я не уверен, что изменилось в Windows 10 с последним обновлением. Ниже моя версия Win10.
Издание: Windows 10 Home Single License Версия: 1903 г. Сборка ОС: 18362.418
Кто-нибудь может мне помочь?