* TLS 1.3 connections have been tested on Ubuntu 18.10 (OpenSSL 1.1.1).
* There's no public version of Windows with TLS 1.3 enabled.
* There's no public version of macOS with TLS 1.3 enabled out of the box.
When making use of SslProtocols.None (system default) TLS 1.3 is already working on Ubuntu 18.10, this change mainly makes it so that EncryptionPolicy.None is better handled, and that we can restrict-to and report TLS 1.3.
Commit migrated from https://github.com/dotnet/corefx/commit/d30157d9e48cf73e267994e45953722d18ccd4c6
* Initial fix.
* Test improvements.
* Add comment explaining fix, revert testing change.
* Add new test validating the behavior for an invalid content-type header, add test case for empty string.
* Store headers.ContentType.CharSet to minimize repeated access.
* Clean up test to not rely on the loopback server.
* Switch test content to use characters outside of ASCII range. Disable test on netfx, since it doesn't have the fix implemented here.
Commit migrated from https://github.com/dotnet/corefx/commit/28e216680a990ce4a58798aa0d2026c9d3e1f148
We have an unexpected rooted cycle that's unexpectedly keeping an HttpConnectionPoolManager and all of its state alive indefinitely if the HttpClient/SocketsHttpHandler isn't Disposed.
HttpConnectionPoolManager creates a "cleaning timer" that runs every now and then in order to remove stale connection pools that are no longer needed. In order to do that, the Timer is passed the HttpConnectionManagerPool as state. That normally wouldn't be a problem, except that the HttpConnectionManagerPool then stores a strong reference to the Timer, creating a cycle: Timer -> TimerHolder -> TimerQueueTimer -> HttpConnectionPoolManager -> Timer. The TimerQueueTimer is rooted by the underlying timer implementation, with it stored in a static array. And TimerHolder has a finalizer that disposes of the Timer, but it's being kept alive as part of the cycle.
To break the cycle, we give the Timer a weak reference (rather than strong reference) to the HttpConnectionPoolManager.
Commit migrated from https://github.com/dotnet/corefx/commit/449190d7c873b56337ba6a7f2d9b53f5232ad16d
Some Http auth related tests have begun failing all the time on Outerloop UWP runs:
* GetAsync_ServerNeedsBasicAuthAndSetDefaultCredentials_StatusCodeUnauthorized
* GetAsync_CredentialIsNetworkCredentialUriRedirect_StatusCodeUnauthorized
The UAP version of Http stack uses WinRT APIs (which use WinInet). And there is
implicit caching of credentials per-process due to WinInet. So, we need to disable
these tests on UAP similar to other tests in this file.
Contributes to dotnet/corefx#32647
Commit migrated from https://github.com/dotnet/corefx/commit/e7e60c52911705bf38cd3dbbfbc9b726209130e7
Rather than check a generic 1.0/1.1, test for the specific library version that
the crypto shim has loaded. This makes things work when both libcurl
and the crypto shim are using OpenSSL 1.1 and also prevents a state where two
different copies of the library (at different patch versions) are utilized.
Commit migrated from https://github.com/dotnet/corefx/commit/d33f8435461028ec131fcfd42232098aaf3e6ded
* skip content-length on DELETE and OPTIONS methods
* breakup long line
* update after sync up
* fix spelling
* skip new test on winhttp
* disable test also on netfx and uap
* feedback from reviews
* use Assert.DoesNotContain for assert
Commit migrated from https://github.com/dotnet/corefx/commit/99211937b4f1735b7912f0a064b91ba60c8e9ca9
* Move uap, uapaot, netfx and netcoreapp constant definitions to top-level build file.
* Trying to fix compilation of PerformanceCounterLib for netcoreapp2.0 targets.
* Change netcoreapp definition to mean the current version only.
* Fix conflict in System.Private.DataContractSerialization.csproj.
* Revert change in src/shims/manual/Directory.Build.props.
* Fix condition in test.
* Bring back TargetsNetCoreApp, it was lost during rebases.
* Move definition of netstandard to top-level build file. Remove more netcoreapp/uap definitions from individual files.
* Fix vbproj compatibility.
* Address PR review and unify the definitions to use TargetGroup directly.
* Add back one "netstandard" definition.
Commit migrated from https://github.com/dotnet/corefx/commit/ac994544e749eac3e85b60bf0012ae2f85ae0e49
Headers marked as `HttpHeaderType.Request` were not able to be accessed
via the `Headers.GetValues` method. When looking up a header,
the `HeaderDescriptor` gets set to to `HttpHeaderType.Custom` in
`GetHeaderDescriptor`, but the persisted header in `_headerStore` had
`HeaderType` set to `HttpHeaderType.Request`, so lookups would fail.
This change makes the insert logic consistent with the lookup logic.
Fixesdotnet/corefx#31143
Commit migrated from https://github.com/dotnet/corefx/commit/8917abaf35ea153f4bbf1098d74d02963ef08e76
The HTTP/2 feature is turned off by default on SocketsHttpHandler since the implementation
is not done. It can be enabled via AppContext or environment variable settings. However,
using those settings is not practical because we need a more granular way of turning on
the HTTP/2 feature for running certain tests.
This PR adds a test helper that uses reflection to set the internal _maxHttpVersion field
of SocketsHttpHandler. I also enabled one HTTP/2 test to demonstrate how to use this test
helper method.
Contributes to dotnet/corefx#31496
Commit migrated from https://github.com/dotnet/corefx/commit/2f9483cdf78c8b6319f471ccb09422a2b0248ee7