title: How to get HTTPS to work in Command Line in Windows 10 (please note that HTTP is working)?
body: <p>I have been searching on the net for a couple of hours already and haven't found a solution.  I've even tried disabling the Windows Firewall and Windows Defender to see if it is blocking the outgoing HTTPS requests from the command line.</p>
  
  <p>I have Node/Npm installed in my Win10 machine and I was trying to install some node modules, but I keep on getting <strong>ECONNRESET</strong> error.  I also have a curl.exe in my System32 folder which is also not working for any HTTPS links I've tried.</p>
  
  <pre><code>&gt;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
  
  &gt;node --version
  v10.16.3
  
  &gt;npm --version
  6.12.0
  </code></pre>
  
  <p>(NOTE: NPM version was originally 6.3.x, details later)</p>
  
  <p>When I try the following, I get handshake errors:</p>
  
  <pre><code>&gt;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
  </code></pre>
  
  <pre><code>&gt;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
  </code></pre>
  
  <p>But changing <strong>HTTPS</strong> to <strong>HTTP</strong> works...</p>
  
  <pre><code>&gt;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)
  &gt; GET / HTTP/1.1
  &gt; Host: www.google.com
  &gt; User-Agent: curl/7.55.1
  &gt; Accept: */*
  &gt;
  &lt; HTTP/1.1 200 OK
  &lt; Date: Sat, 19 Oct 2019 01:20:34 GMT
  &lt; Expires: -1
  &lt; Cache-Control: private, max-age=0
  [RESPOSNE WAS TOO LONG TO INCLUDE IN POST, NO SENSE IN PASTING THE WHOLE THING]
  </code></pre>
  
  <p>So as you can see, HTTPS is giving errors, but not HTTP.  I don't have any proxy configured, I don't have limitations in my network, and I even tried disabling Windows Firewall and Windows Defender.  I have an Ubuntu WSL, an Ubuntu VM (via vmware) in the same machine and there is no problem with HTTPS in them.</p>
  
  <p>To test this, I change the npm registry from <strong>https to http</strong></p>
  
  <p>WITH NPM REGISTRY SET TO <strong>HTTPS</strong></p>
  
  <pre><code>&gt;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
  </code></pre>
  
  <p>WITH NPM REGISTRY SET TO <strong>HTTP</strong></p>
  
  <pre><code>&gt;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)
  </code></pre>
  
  <p>As you can see from above, no issue if its HTTP.  I remember specifically, HTTPS used to work a few months back, so I am not sure what was changed in Windows 10 with the latest update.  Below is my Win10 version.</p>
  
  <p>Edition: Windows 10 Home Single License
  Version: 1903
  OS Build: 18362.418</p>
  
  <p>Can anybody help me?</p>