WinHTTP returns an error from WinHttpQueryAuthSchemes if a server sends back a response with a scheme that isn't handled by WinHTTP. Many servers use custom auth schemes. A few don't even send a `WWW-Authenticate` header in the response at all (technically against RFC7235). To handle these cases and to match Desktop behavior, we ignore the error from WinHttpQueryAuthSchemes.
Fixesdotnet/corefx#11452 and dotnet/corefx#11456.
Commit migrated from https://github.com/dotnet/corefx/commit/ff50e500356f94c566baef786cc23e78cee870fd
We were getting an error "The parameter is incorrect" from WinHTTP when we tried to invoke default credential handling even for cases where the server doesn't use Negotiate or NTLM. Negotiate and NTLM are the only schemes that can use default credentials since they need to be transmitted via a challenge-response mechanism.
The fix here is to only set WinHTTP default credentials handling for Negotiate or NTLM schemes. Otherwise, it should behave as-if there were no credentials set.
Fixesdotnet/corefx#11266
Commit migrated from https://github.com/dotnet/corefx/commit/f48eb3480c51dd5b08fe6089c8d7a5041019d1e8
Lately, the CI system and test server infrastructure has been overloaded with many PRs. This is causing many networking tests to randomly fail due to resource exhaustion caused by so many simultaneous PR runs on the same CI machines. This occurrs not only when using an external test server endpoint (corefx-net.cloudapp.net) but also loopback servers.
To improve engineering efficiency for the team, we are moving most of the tests in the networking libraries from the default CI runs (innerloop). For developers working on networking libraries, the networking tests can be run by invoking the "outerloop" tests.
We will not be allowing any merges of PRs in the networking libraries unless the outerloop tests are also run by the developer.
This affects tests in the following libraries right now:
* System.Net.Http
* System.Net.Http.WinHttpHandler
* System.Net.Sockets
* System.Net.Security
* System.Net.WebSockets.Client
I will be working on fine tuning these exclusions (issue dotnet/corefx#11345) to try to bring back tests into the innerloop runs when we have begun to address the infrastructure issues.
Commit migrated from https://github.com/dotnet/corefx/commit/defbb8afd11b317f6b5cc2f4422a03d701b6dba3
There is a behavior difference between .NET Framework (Desktop) and
CoreFx. Desktop will send some reserved characters (such as square
brackets) on the wire as-is without any percent-encoding. CoreFx using
WinHttpHandler is doing additional percent-encoding on those characters.
This fix changes WinHttpHandler behavior so that it won't do any additional
percent-encoding. Whatever encoding System.Uri has done will be
transmitted as-is.
There is a separate problem where System.Uri itself doesn't
percent-encode these characters during normalization. That is due to
changes in the .NET Framework 4.5 timeframe (2012) where System.Uri was changed to
follow more IRI (RFC 3987) rules. One could argue that was the real
problem. But since this behavior is already baked into .NET Framework,
the right fix for the below issue is to match Desktop behavior.
We will be having a separate discussion/issue to analyze/debate whether System.Uri
needs to be changed (or not) in the future. The various URI and HTTP RFCs have
ambiguous language in these areas.
Fixesdotnet/corefx#11156
Commit migrated from https://github.com/dotnet/corefx/commit/429dfa4c320830ef3dc2d84f065064cc33239f1d
Windows 10 Anniversary release a.k.a Windows 10 Version 1607 added support to native WinHTTP for HTTP/2 protocol support. Added code to use this when sending request messages with HTTP/2. This change affects both the System.Net.Http and System.Net.Http.WinHttpHandler library packages.
Added new tests that validate the functionality and verify the test client is running on the proper version of Windows 10.
Switched the HTTP/2 test server endpoint to www.microsoft.com since it supports HTTP/2.
Fixesdotnet/corefx#4870
Commit migrated from https://github.com/dotnet/corefx/commit/16246fde864d7f88f56ed0ac76055711116192e9