Skip to content

WinHttp tests with Tls 1.3 are failing #58587

Closed

Description

@wfurt

This showed up in attempt to add Windows 11 test queue. We never tried to run WinHttp with TLS 1.3 before.
At this point it is not clear if this is limitation of WinHttp or if there is work we need to do at .NET.

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-58570-merge-71d5888539224bb281/System.Net.Http.WinHttpHandler.Functional.Tests/1/console.d7f8ff6e.log?sv=2019-07-07&se=2021-09-22T18%3A25%3A20Z&sr=c&sp=rl&sig=ZUf%2BvlsRaiZhT8qXiJFDFL%2FkE%2BjPMYjAMKnuOtaIDiM%3D

Easy to reproduce locally:

System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_SslProtocols_Http2_Test.GetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol: Tls13, requestOnlyThisProtocol: True) [FAIL]
        System.Net.Http.HttpRequestException : An error occurred while sending the request.
        ---- System.Net.Http.WinHttpException : Error 87 calling SetSessionHandleTlsOptions, 'The parameter is incorrect.'.
        Stack Trace:
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http\src\System\Net\Http\HttpClient.cs(527,0): at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(55,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(82,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(49,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\tests\System\Net\Http\HttpClientHandlerTest.SslProtocols.cs(135,0): at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass5_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__2>d.MoveNext()
          --- End of stack trace from previous location ---
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\tests\System\Net\Http\LoopbackServer.cs(101,0): at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\tests\System\Net\Http\HttpClientHandlerTest.SslProtocols.cs(133,0): at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.GetAsync_AllowedSSLVersion_Succeeds(SslProtocols acceptedProtocol, Boolean requestOnlyThisProtocol)
          --- End of stack trace from previous location ---
          ----- Inner Stack Trace -----
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Private.CoreLib\src\System\Environment.cs(210,0): at System.Environment.get_StackTrace()
          C:\Users\test\github\wfurt-runtime\src\libraries\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs(22,0): at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpException.cs(58,0): at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error, String nameOfCalledFunction)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(1196,0): at System.Net.Http.WinHttpHandler.SetSessionHandleTlsOptions(SafeWinHttpHandle sessionHandle)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(1121,0): at System.Net.Http.WinHttpHandler.SetSessionHandleOptions(SafeWinHttpHandle sessionHandle)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(876,0): at System.Net.Http.WinHttpHandler.EnsureSessionHandleExists(WinHttpRequestState state)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(901,0): at System.Net.Http.WinHttpHandler.StartRequestAsync(WinHttpRequestState state)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs(38,0): at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
             at System.Net.Http.WinHttpHandler.StartRequestAsync(WinHttpRequestState state) in System.Net.Http.WinHttpHandler.dll:token 0x60000da+0x26
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(632,0): at System.Net.Http.WinHttpHandler.<>c.<SendAsync>b__117_0(Object s)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs(268,0): at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
          C:\Users\test\github\wfurt-runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs(2331,0): at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

Activity

  1. ghost added
    untriaged
    on Sep 2, 2021
  2. ghost added
    in-pr
    on Sep 2, 2021
  3. added this to the 6.0.0 milestone on Sep 3, 2021
  4. added
    enhancement
    and removed
    untriaged
    on Sep 3, 2021
  5. ghost removed
    in-pr
    on Sep 4, 2021
  6. karelz commented on Sep 6, 2021

    @karelz
    Member

    Reopening for backport to 6.0

  7. reopened this on Sep 6, 2021
  8. karelz commented on Sep 15, 2021

    @karelz
    Member

    Fixed in 6.0 RC2 in PR #58718 and PR #59159.
    Fixed in 7.0 in PR #58590 and PR #58570.

  9. ghost locked as resolved and limited conversation to collaborators on Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.Httpenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions