Commit Graph
1154 Commits
Author SHA1 Message Date
Caesar Chen 81f8344e17 Fix CVE-2019-0545: .NET Core Information Disclosure Vulnerability (.NET Core 3.0) (dotnet/corefx#34507)
* fix 100-continue issues

* address feedback


Commit migrated from https://github.com/dotnet/corefx/commit/04b237b2f91ae4b4bb709fa60b51fa6ad7f4bc97
2019-01-11 14:34:02 -08:00
Geoff Kizer 1329b56e06 fix UWP test
Commit migrated from https://github.com/dotnet/corefx/commit/3fb6dd4a0298f61a1a896a0d29e117d8ee95af0f
2019-01-09 12:49:33 -08:00
Geoff Kizer d33615e499 rename HttpClientTestBase to HttpClientHandlerTestBase
Commit migrated from https://github.com/dotnet/corefx/commit/b26e2a66e5c41c3263caf5fdaa8a1811dd360e33
2019-01-09 02:44:04 -08:00
Geoff Kizer 834b812e22 remove handler dependency in HttpClientTest
Commit migrated from https://github.com/dotnet/corefx/commit/93719a61bb57729d940a8f20d7884e06dd935af7
2019-01-09 02:32:23 -08:00
Geoff Kizer b5bea157d6 Merge pull request dotnet/corefx#34347 from geoffkizer/decomptests
consolidate decompression tests

Commit migrated from https://github.com/dotnet/corefx/commit/814775ca14faff98602ad2d33f8f443e1e7dce24
2019-01-04 14:40:30 -08:00
Liudmila Molkova 2ce99327c2 Do not add Request-Id header when its added already (dotnet/corefx#34321)
Commit migrated from https://github.com/dotnet/corefx/commit/fe6e895de1fe78c5e677895a1dcf1f6339561153
2019-01-04 09:00:07 -05:00
Geoff Kizer 6386c5af53 consolidate decompression tests
Commit migrated from https://github.com/dotnet/corefx/commit/474b87aeaa9c0ddfe411d3a5d473a20c35f28622
2019-01-03 17:33:45 -08:00
Geoff Kizer 66c9cd06da split redirect tests into separate file
Commit migrated from https://github.com/dotnet/corefx/commit/33aa830e7975d6fdf50143348cb78f2924d673de
2019-01-01 16:00:52 -08:00
Geoff Kizer fedc25a537 disable flaky test SchSendAuxRecordHttpTest
Commit migrated from https://github.com/dotnet/corefx/commit/d08226feeb0af0ff41c8d41b36ba8f6bb97c1785
2018-12-31 15:30:36 -08:00
Max Kerr a3c1c57a27 Improve handling of disallowed HTTP/2 frames (dotnet/corefx#34188)
Additional tests and minor error handling changes.


Commit migrated from https://github.com/dotnet/corefx/commit/d5c4c725c2ee768c93be94a90342f88ef3a584d4
2018-12-21 10:02:46 -08:00
Geoff Kizer fb3edd1440 address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/d5d1abf80078610389b956db3d4f42a5fdc11f0d
2018-12-18 18:45:17 -08:00
Geoff Kizer cea5d77c90 fix typo
Commit migrated from https://github.com/dotnet/corefx/commit/23b717a60f48e90ccc8b51d9fba2aab37e05cd76
2018-12-18 15:41:00 -08:00
Geoff Kizer 3c234c01fc implement SETTINGS_MAX_CONCURRENT_STREAMS handling
Commit migrated from https://github.com/dotnet/corefx/commit/06f67c0ed6240b1f886334aeb4c1a34fc29582a9
2018-12-17 16:03:26 -08:00
Geoff Kizer 3b7e8854b4 respect SETTINGS_INITIAL_WINDOW_SIZE and rework SendAsync code structure
Commit migrated from https://github.com/dotnet/corefx/commit/04fb2722d89a65ce92d8caa90e1e39a0ab4c3d5f
2018-12-17 13:42:31 -08:00
Geoff Kizer 09bf3552bf improve SETTINGS handling and other small changes
Commit migrated from https://github.com/dotnet/corefx/commit/c260486e788ef057909ff4dde813522a5816d2b1
2018-12-13 16:38:08 -08:00
Geoff Kizer 3fb8ce8bf0 implement outbound flow control
Commit migrated from https://github.com/dotnet/corefx/commit/a43253650f18a75383707a3a62fe761332317c85
2018-12-12 18:47:49 -08:00
Geoff Kizer 47b90c25e3 Merge pull request dotnet/corefx#34016 from geoffkizer/http2responsewindow
HTTP2: Implement inbound flow control support

Commit migrated from https://github.com/dotnet/corefx/commit/95406c508940bbb42d7de2eb6b19b88cef15cb1e
2018-12-12 12:25:07 -08:00
Geoff Kizer a73cb2343d add inbound window update support
Commit migrated from https://github.com/dotnet/corefx/commit/fea9123a7b50b0e26214298d0adf8c8941d8f100
2018-12-11 18:23:47 -08:00
Geoff Kizer 815bf9fc33 improve test filter for bogus VPN IPv6 link local addresses
Commit migrated from https://github.com/dotnet/corefx/commit/62d2de45550b12acbc048dfabb21251067fb5b03
2018-12-11 14:41:01 -08:00
Geoff Kizer 7daa91aad2 Merge pull request dotnet/corefx#33952 from geoffkizer/http2outbound2
HTTP2: Rework send logic and support request body send

Commit migrated from https://github.com/dotnet/corefx/commit/c30f2bc75066aeccd610f36c8ce84ae5aaff675a
2018-12-11 13:05:35 -08:00
Geoff Kizer 25cd4ea624 remove test calls to EnsureHttp2Feature that are no longer necessary
Commit migrated from https://github.com/dotnet/corefx/commit/79481df38ed168758f4ac6e6fcd4cc5f9cb5611d
2018-12-10 10:31:38 -08:00
Geoff Kizer cfa3fa2365 support request bodies and rework overall send logic
Commit migrated from https://github.com/dotnet/corefx/commit/dba358046535ee05a3a6c23a76c93877819c3bfe
2018-12-10 04:32:14 -08:00
Viktor Hofer 66e8f64d31 Consume Microsoft.DotNet.CoreFxTesting package (dotnet/corefx#33423)
* Consume Microsoft.DotNet.CoreFxTesting package

* Remove code coverage dedicated runtime dir config files and switch to Coverlet

* Add global tool support in corefx

* Update code coverage docs

Commit migrated from https://github.com/dotnet/corefx/commit/ae38b7cc3762d832fdcebe27a0aab7b22ab2f3fa
2018-12-06 02:56:11 +01:00
Jeremy Barton cefe07725e Add initial support for TLS 1.3 to .NET Core
* 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
2018-11-12 17:49:05 -08:00
Max Kerr e742fd7a06 Fix Content-Type parsing of quoted charsets (dotnet/corefx#33280)
* 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
2018-11-08 11:11:28 -08:00
Stephen Toub f42f25247a Fix Timer rooting issue with SocketsHttpHandler (dotnet/corefx#32793)
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
2018-10-13 20:40:04 -04:00
Max Kerr 8e99673f97 Fix flaky 100-Continue test on CurlHandler. (dotnet/corefx#32653)
Commit migrated from https://github.com/dotnet/corefx/commit/5ee58d9cf528db08230edb201471da28cd7a5fe5
2018-10-05 17:40:00 -07:00
David Shulman e03c1b170b Skip some Http auth tests on UAP (dotnet/corefx#32646)
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
2018-10-05 14:21:56 -07:00
Filip Navara ef59f0f707 Treat the 'algorithm' parameter in Digest HTTP authentication as case-insensitive. (dotnet/corefx#32632)
Fixes dotnet/corefx#32408


Commit migrated from https://github.com/dotnet/corefx/commit/1d737919b3a74dd3d26a80b2268014b48a41a8d4
2018-10-05 11:11:16 -07:00
Marco Rossignoli eed59da488 Fix HttpClient sending fragment portion of uri on request (dotnet/corefx#32574)
Fixes dotnet/corefx#32378


Commit migrated from https://github.com/dotnet/corefx/commit/87a944afb3e0ec392d5838900b5498e015d5e47b
2018-10-04 09:40:41 -07:00
Tomas Weinfurt 256e18fcd3 disable ConnectTimeout_TimesOutSSLAuth_Throws (dotnet/corefx#32564)
Commit migrated from https://github.com/dotnet/corefx/commit/b3475286fbfff67869f8fbc76f391c1f43a40f53
2018-10-01 13:38:57 -07:00
Tomas Weinfurt 6b900e8e6f socket handler does not depend on platfrom curl (dotnet/corefx#32543)
Commit migrated from https://github.com/dotnet/corefx/commit/20b2f55558f729f24fc063f520b35ab0adeec924
2018-09-29 14:28:39 -07:00
Jeremy Barton e54864fbc0 Check for the specific in-use version of OpenSSL when working with libcurl
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
2018-09-26 15:35:35 -07:00
Santiago Fernandez Madero 5267216c37 Fix assert failing when getting network interfaces (dotnet/corefx#32394)
* Fix assert failing when getting network interfaces

* PR Feedback


Commit migrated from https://github.com/dotnet/corefx/commit/cae2180e1443e1ace51f7498e48fd84d95550358
2018-09-25 18:11:13 -04:00
Tomas Weinfurt 765e7510f9 skip content-length on DELETE and OPTIONS methods with no body (dotnet/corefx#32259)
* 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
2018-09-16 19:53:34 -07:00
Geoff Kizer adff026bf7 Merge pull request dotnet/corefx#32211 from jbhensley/huffman-test
Added additional unit test scenario to Huffman encoding tests

Commit migrated from https://github.com/dotnet/corefx/commit/0a51fb5ff782f2f27ec4241feedfb90699de7361
2018-09-13 12:09:20 -07:00
jbhensley 0cd42d57af Fix whitespace
Commit migrated from https://github.com/dotnet/corefx/commit/a64edcab4735be20171206366ebeb878db0aac10
2018-09-12 13:05:08 -07:00
David Shulman 50526554e2 Disable nt auth tests on Nano (dotnet/corefx#32247)
The recent PR dotnet/corefx#32146 added these new tests.  But they fail on Nano SKU because HttpListener is not supported since http.sys is not present on Nano.

Commit migrated from https://github.com/dotnet/corefx/commit/9772bdfd5f61ab6587cdc93efc51f6e0101b24bc
2018-09-11 20:18:16 -07:00
Geoff Kizer 07f7385c42 HttpClient: add simple nt auth tests (dotnet/corefx#32212)
* add basic nt auth tests

* address review feedback and disable tests on non-Windows platforms


Commit migrated from https://github.com/dotnet/corefx/commit/860509c967c8566b36fc134b5ea001489e2289b3
2018-09-11 15:07:21 -07:00
jbhensley 4b015a412a Added test to emit EOS in the middle of an otherwise valid sequence.
Commit migrated from https://github.com/dotnet/corefx/commit/673c537c39f69df985e1f42a3861d57bd431764d
2018-09-10 17:21:11 -07:00
Geoff Kizer 48a62f1420 fix typos
Commit migrated from https://github.com/dotnet/corefx/commit/8e8a58be46c3c86452f5552ab861e59aef34db98
2018-09-06 16:37:24 -07:00
Geoff Kizer 14ae4f7b95 fix tests to use Span
Commit migrated from https://github.com/dotnet/corefx/commit/c77e291abc15e646d5223c4dc84f547f9858f923
2018-09-06 15:01:53 -07:00
Geoff Kizer 1140844668 fix Huffman decoding issue and add Huffman decoding tests
Commit migrated from https://github.com/dotnet/corefx/commit/e5388b2fd7f9ab29800426f843b0c026b49ba7e4
2018-09-06 14:30:04 -07:00
Max Kerr 35c26def3f Disable test that appears to be causing a hang in System.Net.Http tests. (dotnet/corefx#32048)
Commit migrated from https://github.com/dotnet/corefx/commit/01d396a97a5c07dd78c0da7fac80f6b4cf23cb40
2018-08-31 12:12:15 -07:00
Filip Navara 2a2c2ef521 Move uap, uapaot, netfx, netcoreapp and netcoreapp20 constant definitions to top-level build file. (dotnet/corefx#31470)
* 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
2018-08-29 08:49:33 -07:00
Viktor Hofer 70bffcd308 Enable netfx perf runs and promote to netstandard
Commit migrated from https://github.com/dotnet/corefx/commit/1b33f6c57bdcb4a2be715a8eaf7ec2483dc5c6c0
2018-08-23 19:55:26 +02:00
Max Kerr 967baf836d Implement HTTP/2 loopback server for frame level testing of SocketsHttpHandler (dotnet/corefx#31521)
This is an initial pass at support for frame level testing of the HTTP/2 protocol.

Commit migrated from https://github.com/dotnet/corefx/commit/66649ff5862c7b723fded40c505942de19bdb107
2018-08-06 14:39:12 -07:00
Caesar Chen cdc9c4261f Add HTTP/2 CookieContainer support (dotnet/corefx#31440)
* http/2 CookieContainer support

* address feedback

* address feedback 2

* remove grouping

* fix test issue


Commit migrated from https://github.com/dotnet/corefx/commit/f1be6ce925a2f3a97d8838674987f543058c0942
2018-08-06 12:44:42 -07:00
Dustin Masters 97531f9946 Fix looking up headers on HttpClient response (dotnet/corefx#31550)
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.

Fixes dotnet/corefx#31143


Commit migrated from https://github.com/dotnet/corefx/commit/8917abaf35ea153f4bbf1098d74d02963ef08e76
2018-08-02 18:16:03 -07:00
David Shulman f10c0336a1 Add test helper to enable SocketsHttpHandler HTTP/2 testing (dotnet/corefx#31530)
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
2018-08-01 11:49:23 -07:00