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

TLS broken : vstest.console.exe still use .NET 4.5 #3733

Closed
tbolon opened this issue Jun 9, 2022 · 6 comments
Closed

TLS broken : vstest.console.exe still use .NET 4.5 #3733

tbolon opened this issue Jun 9, 2022 · 6 comments

Comments

@tbolon
Copy link

tbolon commented Jun 9, 2022

Description

vstest.console project still target net4.5, beside the fact that it's not supported anymore since 2015.

It adds a problem: by default, .net apps build against .net version 4.5 do not use TLS 1.2, so if tests are using HTTP requests to call a server where only TLS 1.2+ is enabled (as per global recommendation) the test will fail.

My reproduction case happens when using Azure DevOps and using vstest task.

Steps to reproduce

  • Create a unit tests which requests an http resource only accessible through TLS 1.2
  • Run the test using any test host (dotnet test, etc.), the test will pass
  • Run the test using vstest.console.exe: the test will fail
-------- System.IO.IOException : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
------------ System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host

Expected behavior

The request should succeed using the most recent TLS protocol available

Actual behavior

The request fail.

Suggestion

You should at least update vstest.console.exe to 4.7.1+

@tbolon
Copy link
Author

tbolon commented Jun 9, 2022

It seems that #3646 will fix this problem,

@nohwnd
Copy link
Member

nohwnd commented Jun 9, 2022

I just closed this one this morning because it never got merged and we never had another report of a related issue. #2472

Now we have one again :D

@nohwnd
Copy link
Member

nohwnd commented Jun 9, 2022

Still we will fix by moving to .net462 in next sprint.

@tbolon
Copy link
Author

tbolon commented Jun 9, 2022

I was just coming back to suggest adding at least the correct AppContextSwitch ;Switch.System.Net.DontEnableSystemDefaultTlsVersions=false. It seems you were quicker :)

@nloyolag
Copy link

Just wanted to jump into this thread to report that we are facing the same issue in our Azure DevOps build pipeline. Looking forward to the fix :)

@Evangelink
Copy link
Member

Fixed by #3646

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants