WinHttpHandler: HttpClientHandlerTestBase.AllowAllCertificates should not be static#48817
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsThe default value of this property is 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
|
|
/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, |
wfurt
left a comment
There was a problem hiding this comment.
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_Testare 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,
allowAllHttp2Certificatesis 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.