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

WinHttp tests with Tls 1.3 are failing #58587

Closed
wfurt opened this issue Sep 2, 2021 · 3 comments · Fixed by #58590
Closed

WinHttp tests with Tls 1.3 are failing #58587

wfurt opened this issue Sep 2, 2021 · 3 comments · Fixed by #58590
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@wfurt
Copy link
Member

wfurt commented Sep 2, 2021

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)
@ghost
Copy link

ghost commented Sep 2, 2021

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

Issue Details

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)
Author: wfurt
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Sep 2, 2021
This was referenced Sep 2, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 2, 2021
@karelz karelz added this to the 6.0.0 milestone Sep 3, 2021
@karelz karelz added enhancement Product code improvement that does NOT require public API changes/additions and removed untriaged New issue has not been triaged by the area owner labels Sep 3, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 4, 2021
@karelz
Copy link
Member

karelz commented Sep 6, 2021

Reopening for backport to 6.0

@karelz
Copy link
Member

karelz commented Sep 15, 2021

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

@karelz karelz closed this as completed Sep 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants