* Turn on xml documentation validation globally.
* Ignore warning 1591 globally.
* Fixed build failures.
* Move the Original DocumentationFile Condition to the Group.
Now NoWarn has no Condition on it.
* Fixed NoWarn overwrite.
* Update Directory.Build.props
* Update System.Runtime.CompilerServices.Unsafe.ilproj
* Update file on github web.
Sadly it seems I can only do this on my phone now. RIP
* Update System.Security.Cryptography.Csp.csproj
* Update Directory.Build.props
* Suppress some warnings.
* Fixed remaining compile errors.
* Update System.Diagnostics.StackTrace.csproj
* Update System.Security.Cryptography.Xml.csproj
* Fixed xml documentation typo in Microsoft.VisualBasic.
* Fixed missing suppressions.
* Suppress more errors.
* Suppress more errors.
* Suppress more errors.
* Suppress even more errors.
* Suppress more errors.
* Update Directory.Build.props
* Suppress more errors.
Also fix a documentation issue specific to OSX.
* Suppress more errors.
* Suppress more errors.
* Disable xml documentation for System.Diagnostics.Process.
* Do not overwrite NoWarn.
* Enable docs for S.D.P
Commit migrated from https://github.com/dotnet/corefx/commit/6abb4cd0bafa2a3c7486fb23bcc611bd211d0f8e
* 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
SocketsHttpHandler was not normalizing the DNS name prior to using it for the SPN
(Service Principal Name). So, when using URI's that involve a CNAME, it was using
the CNAME directly and not evaluating it to the normalized FQDN A record of the host.
This change fixes the behavior to match .NET Framework so that CNAMEs are resolved
properly. We can use the standard Dns.GetHostEntryAsync() API to resolve the name.
From a performance perspective, this additional DNS API call is limited to just
the SPN calculation for NT Auth. Calling this API doesn't impact the performance on the
wire since the OS will cache DNS calls. Wireshark confirms that no additional DNS
protocol packets will be sent.
.NET Framework actually caches the normalized DNS resolution on the ServicePoint object
when it opens up a connections. Thus, it doesn't have to call Dns.GetHostEntryAsync()
for the SPN calculation. While a future PR could further optimize SocketsHttpHandler to
also cache this DNS host name, it isn't clear it would result in measurable performance gain.
I tested this change in a separate Enterprise testing environment I set up. I created
a CNAME for a Windows IIS server in a Windows domain-joined environment and demonstrated that
the Negotiate protocol results in a Kerberos authentication (and doesn't fall back to NTLM).
Fixesdotnet/corefx#32328
Commit migrated from https://github.com/dotnet/corefx/commit/684114f26dbc23341b5ae5f8626fb748ac6cec2b
* 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
When a response includes a Content-Length header and the caller uses CopyToAsync to extract all data from the resulting stream, we're currently ignoring the supplied bufferSize, as we just repeatedly copy through the HttpConnection's existing read buffer. For short responses, this is fine. For longer responses, on a slower connection, this is also fine. But for longer responses on a fast connection where the data is available quickly and often fills the buffer, we can end up making many more network requests than is necessary. HttpConnection's default buffer size is 4K, and although it can grow, it only does so when the response headers need it. In contrast, the default buffer size used by Stream.CopyToAsync is 80K, and a developer can specify any bufferSize they want in order to control the memory vs throughput trade-off. To better handle this, this commit allows for ContentLengthReadStream to temporarily swap out the HttpConnection's buffer for a larger one pulled from ArrayPool.Shared, just as does the base Stream.CopyToAsync. This allows it to respect the supplied bufferSize, while not draining the shared pool of large buffers for extended periods of time, only while the processing of the response is in progress.
Commit migrated from https://github.com/dotnet/corefx/commit/a66747cec82ffc96f43152ee52f5e0c1718a6d43
SocketHttpHandler will use a ConnectionCloseReadStream as the resulting stream it hands out if the server sent Connection: close. If CopyToAsync is used from that stream, it falls back to just using CopyToAsync on the underlying stream (usually a NetworkStream or SslStream). In doing so, though, if there is already some data remaining in the HttpConnection's buffer, it first has to copy the data from that buffer, and then when it goes to use CopyToAsync on the underlying stream, it neglects to pass through the caller provided bufferSize. This fixes that.
Commit migrated from https://github.com/dotnet/corefx/commit/343c98837c8959f18f75143126a5ac801adc3db0
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
Minimize the work done inside the lock in order to reduce contention. This means we need to reacquire the lock if the connection isn't usable, but in the fast path case where the connection is usable, we remove the syscalls from being performed while holding the lock.
Commit migrated from https://github.com/dotnet/corefx/commit/ac2f2e7e64502b456d06592aa1d3f92a5048503a
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