Vscode-remote-release: The underlying connection was closed: An unexpected error occurred on a send

Created on 29 Jan 2020  路  7Comments  路  Source: microsoft/vscode-remote-release

https://github.com/microsoft/vscode-remote-release/issues/78#issuecomment-571002756

Sometimes downloading the remote server on Windows fails with an error message like

Failed to download & extract vscode-server. - The underlying connection was closed: An unexpected error occurred on a send.

Seems to be a cert issue because one user reports that the SkipCertificateCheck property fixes it.

bug ssh verified windows

Most helpful comment

This should be fixed in the nightly extension now, please try it out

All 7 comments

This seems to be more of a protocol issue than a cert issue. On my Windows Server 2016 box [System.Net.ServicePointManager]::SecurityProtocol returns Ssl3, Tls.
According to SSL Server Test, _update.code.visualstudio.com_ supports TLS 1.2 only, which would explain the connection refused.

This can be confirmed in PowerShell by trying to connect to https://update.code.visualstudio.com/ before and after turning TLS 1.2 on:

TLS 1.2 off

> Invoke-WebRequest https://update.code.visualstudio.com/

Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Invoke-WebRequest https://update.code.visualstudio.com/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

TLS 1.2 on

> [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

> Invoke-WebRequest https://update.code.visualstudio.com/

StatusCode        : 200
StatusDescription : OK
Content           : Hello from VS Code! 馃憢
RawContent        : HTTP/1.1 200 OK
                    request-context: appId=cid-v1:8109e553-6232-492a-afca-b78cea9b431c
                    Strict-Transport-Security: max-age=31536000
                    X-Content-Type-Options: nosniff
                    X-Source-Commit: 5b1e6aaf6afec2feec21...
Forms             : {}
Headers           : {[request-context, appId=cid-v1:8109e553-6232-492a-afca-b78cea9b431c], [Strict-Transport-Security,
                    max-age=31536000], [X-Content-Type-Options, nosniff], [X-Source-Commit,
                    5b1e6aaf6afec2feec218a378676e943da8f7885]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 24

~Is there a simple way to turn it on in a persistent way?~
I applied the registry keys in this doc and it works!

I鈥檓 wondering if the error reported to the user could suggest the solution here?

This should be fixed in the nightly extension now, please try it out

I was looking for the commits, but I can't find the code :} I guess this part isn't out in the open.

Yeah the extension is not open source

Tried the latest nightly and everything works perfectly now. Thanks a lot @roblourens !

Was this page helpful?
0 / 5 - 0 ratings