dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.08k stars 4.69k forks source link

[Linker][Tests] HttpClientTests fails with System.Net.Http.HttpRequestException: The SSL connection could not be established #104682

Closed mdh1418 closed 2 months ago

mdh1418 commented 2 months ago

The dotnet-linker-tests pipeline osx-x64 runtime release lane has been failing frequently since job #20240709.4 with a failure stemming from HttpClient.GetAsync(string)

  Unhandled exception. System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
   ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
     at System.Net.Security.SslStream.ProcessTlsFrame(Int32)
     at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean, Byte[], CancellationToken)
     at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions, HttpRequestMessage, Boolean, Stream, CancellationToken)
     --- End of inner exception stack trace ---
     at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions, HttpRequestMessage, Boolean, Stream, CancellationToken)
     at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage, Boolean, CancellationToken)
     at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage, Boolean, CancellationToken)
     at System.Net.Http.HttpConnectionPool.InjectNewHttp11ConnectionAsync(QueueItem)
     at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken)
     at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage, Boolean, Boolean, CancellationToken)
     at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage, Boolean, CancellationToken)
     at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
     at Program.Main(String[]) in /_/artifacts/bin/trimmingTests/projects/System.Net.Http.TrimmingTests/HttpClientTest/osx-x64/HttpClientTest.cs:line 20
     at Program.<Main>(String[])
  /var/folders/0f/b0mzpg5d31z074x3z5lzkdxc0000gn/T/MSBuildTemprunner/tmp4c45bac47fd9439fb89baa06a58ce333.exec.cmd: line 2: 52950 Abort trap: 6           /Users/runner/work/1/s/artifacts/bin/trimmingTests/projects/System.Net.Http.TrimmingTests/HttpClientTest/osx-x64/bin/Release/net9.0/osx-x64/publish/project
/Users/runner/work/1/s/eng/testing/linker/trimmingTests.targets(168,5): error : Error: [Failed Test]: /Users/runner/work/1/s/src/libraries/System.Net.Http/tests/TrimmingTests/HttpClientTest.cs. The Command /Users/runner/work/1/s/artifacts/bin/trimmingTests/projects/System.Net.Http.TrimmingTests/HttpClientTest/osx-x64/bin/Release/net9.0/osx-x64/publish/project return a non-success exit code 134. [/Users/runner/work/1/s/src/libraries/System.Net.Http/tests/TrimmingTests/System.Net.Http.TrimmingTests.proj]
##[error]eng/testing/linker/trimmingTests.targets(168,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) Error: [Failed Test]: /Users/runner/work/1/s/src/libraries/System.Net.Http/tests/TrimmingTests/HttpClientTest.cs. The Command /Users/runner/work/1/s/artifacts/bin/trimmingTests/projects/System.Net.Http.TrimmingTests/HttpClientTest/osx-x64/bin/Release/net9.0/osx-x64/publish/project return a non-success exit code 134.

At a glance, it seems to be an authentication issue, similar to https://github.com/dotnet/runtime/issues/104605 where both hit SslStream.ForceAuthenticationAsync -> SslStream.ProcessTlsFrame

Given that https://github.com/dotnet/runtime/pull/103419 changed ProcessTlsFrame, it seems more likely those changes are the culprit, as suspected in https://github.com/dotnet/runtime/issues/104605

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones See info in area-owners.md if you want to be subscribed.

rzikm commented 2 months ago

Should be fixed by https://github.com/dotnet/runtime/pull/104606