Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The underlying connection was closed: An unexpected error occurred on a send #2261

Closed
roblourens opened this issue Jan 29, 2020 · 7 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded windows Issue on Windows
Milestone

Comments

@roblourens
Copy link
Member

#78 (comment)

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.

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH windows Issue on Windows labels Jan 29, 2020
@roblourens roblourens added this to the February 2020 milestone Jan 29, 2020
@roblourens roblourens self-assigned this Jan 29, 2020
@daniel-liuzzi
Copy link

daniel-liuzzi commented Feb 1, 2020

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

@jsg2021
Copy link

jsg2021 commented Feb 3, 2020

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

@jsg2021
Copy link

jsg2021 commented Feb 4, 2020

I’m wondering if the error reported to the user could suggest the solution here?

@roblourens
Copy link
Member Author

roblourens commented Feb 4, 2020

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

@jsg2021
Copy link

jsg2021 commented Feb 4, 2020

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

@roblourens
Copy link
Member Author

Yeah the extension is not open source

@daniel-liuzzi
Copy link

daniel-liuzzi commented Feb 4, 2020

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

@connor4312 connor4312 added the verified Verification succeeded label Feb 27, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded windows Issue on Windows
Projects
None yet
Development

No branches or pull requests

4 participants