-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
WinHttpHandler: HttpClientHandlerTestBase.AllowAllCertificates should not be static #48817
WinHttpHandler: HttpClientHandlerTestBase.AllowAllCertificates should not be static #48817
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsThe default value of this property is runtime/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs Lines 275 to 282 in 1d9e50c
This is the root cause of the failures I discovered in #48704 (comment), and a prerequisite to proceed with that PR, since the new tests are incorrect there (although they are all skipped on today's CI machines, so we can't see the failures in the PR). /cc @geoffkizer @wfurt
|
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
@dotnet/ncl this is ready for review again. Instead of changing the static property to an instance one, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
While this looks ok and solves particular problem I'm wondering about the tests.
AllowAllCertificates generally skips all TLS cert validation so I'm curious why this is set only for platform handler and why only for HTTP2. I would expect that certificate processing is not dependent on HTTP protocol version.
I was wondering about the same. @scalablecory @geoffkizer any thoughts on this? Gonna merge this to unblock #48704. |
The default value of this property is
true
. Tests like likePlatformHandler_HttpClientHandler_ServerCertificates_Http2_Test
are altering this global state, which may cause subsequently executed tests to fail because their prerequisites are not met:runtime/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs
Lines 275 to 282 in 1d9e50c
This is the root cause of the failures I discovered in #48704 (comment), and a prerequisite to proceed with that PR, since the new tests are incorrect there (although they are all skipped on today's CI machines, so we can't see the failures in the PR).
/cc @geoffkizer @wfurt
Update
Instead of changing the static property to an instance one,
allowAllHttp2Certificates
is now a parameter of the general, shared overload ofCreateHttpClientHandler(...)
. This way individual test classes can implement their mechanism to manage this parameter, so far the only one isHttpClientHandler_ServerCertificates_Test
.