Commit Graph
1490 Commits
Author SHA1 Message Date
Geoff Kizer a8ffcf7322 fix stress response generation, and disable failing test (dotnet/corefx#27059)
Commit migrated from https://github.com/dotnet/corefx/commit/472c3d95749910ba600df296bbf01d78d7c4f6d8
2018-02-12 07:25:24 -05:00
Stephen Toub ee5f5d76a1 Tweak CurlHandler SSL not supported messages to be more helpful (dotnet/corefx#27043)
* Tweak CurlHandler SSL not supported messages to be more helpful

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/9cde3e174b2495cbcdf95995aea0bea4030d4aa9
2018-02-12 05:27:57 -05:00
Geoff Kizer 2927c099bf Merge pull request dotnet/corefx#26989 from geoffkizer/fixcookiehandling
SocketsHttpHandler: Fix some issues with cookie handling, and add cookie tests

Commit migrated from https://github.com/dotnet/corefx/commit/8cee267154ef9dc6dde7a76a828844a200437872
2018-02-11 18:23:50 -08:00
Geoff Kizer e4d9a6c5c8 fix tests on netfx
Commit migrated from https://github.com/dotnet/corefx/commit/c7cc2a879d0a5b5f039caff36bef0c99f52604a2
2018-02-11 14:49:42 -08:00
Geoff Kizer ef25741e58 consolidate cookie tests
Commit migrated from https://github.com/dotnet/corefx/commit/c20262c69a93449498d511014e9e69bad18f987a
2018-02-11 12:38:20 -08:00
Stephen Toub 5c894d6b17 Add SocketsHttpHandler check for TransferEncodingChunked w/o Content (dotnet/corefx#27040)
Commit migrated from https://github.com/dotnet/corefx/commit/bf5a3183bc901723ebe0bb3d178bec86cda57429
2018-02-11 12:19:03 -05:00
Geoff Kizer f7a5007eaa address review feedback
Commit migrated from https://github.com/dotnet/corefx/commit/15beaca5f2062792bf4a2dd137a42d6e53f98e5e
2018-02-09 13:00:16 -08:00
Tomas Weinfurt 844d6893d1 minimal support for ManagedHandler proxy configuration on Windows (dotnet/corefx#26878)
* initial implementation 

Commit migrated from https://github.com/dotnet/corefx/commit/468db63e2648f8a4c0c82d97e301e308b7887f7e
2018-02-09 12:05:30 -08:00
Geoff Kizer 5a05ac3821 rework cookie logic to address issues and remove CookieHandler
Commit migrated from https://github.com/dotnet/corefx/commit/7d11d419421cc9bea0b8fa3d186bb6a406cd3a4b
2018-02-09 00:45:09 -08:00
Geoff Kizer 3a5fbcf1c2 add protocol tests for cookie handling
Commit migrated from https://github.com/dotnet/corefx/commit/750b29bbb1433ad5d4c3727217192dddbef90eef
2018-02-09 00:37:09 -08:00
Caesar Chen 1717bb7f67 Disable Http status line test cases on CurlHandler (dotnet/corefx#26982)
Commit migrated from https://github.com/dotnet/corefx/commit/6730463bd0bb1a65e679b8a6643d611b69086b29
2018-02-08 20:54:34 -08:00
Stephen Toub 296015a364 Add more SocketsHttpHandler tests
Commit migrated from https://github.com/dotnet/corefx/commit/8cb4d130bc3e8151fc72fe9494787643c7b00c4b
2018-02-08 19:12:50 -05:00
Stephen Toub 89dfde815e Expose SocketsHttpHandler
- Renames ManagedHandler to SocketsHttpHandler
- Moves a bunch of files around accordingly
- Updates System.Net.WebSockets.Client to use SocketsHttpHandler directly
- Updates System.Net.Http's tests with a reflection-based rather than TLS-based method for instantiating an HttpClientHandler backed by a SocketsHttpHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/852d40e723c849e8d0c486676d40332343e12ca5
2018-02-08 19:12:50 -05:00
Stephen Toub 4597cdf7e3 Ensure EventData structs in EventSource implementations are zero'd (dotnet/corefx#26968)
In preparation for clearing initlocals.

Commit migrated from https://github.com/dotnet/corefx/commit/f3e7e18b4baa70adeb0ba9a02d80d3acf0f796e3
2018-02-08 17:42:43 -05:00
Caesar Chen 3c4000f401 Enable HttpProtocolTest status line test cases (dotnet/corefx#26798)
* enable all test data

* seperate test data

* add one missing data

* address pr feedabck

* address feedback

* disable test by active issue & add else clause


Commit migrated from https://github.com/dotnet/corefx/commit/426e1c72a0dbda1aece127ec5f56696dc465d74b
2018-02-08 09:18:21 -08:00
Stephen Toub c8c6ae416a Switch ManagedHandler to use SslClientAuthenticationOptions (dotnet/corefx#26870)
Simplifies the public ManagedHandler API by using the now existing SslClientAuthenticationOptions bag as a way to pass in all of the SSL-related options.  This also means we start enabling anything already on SslClientAuthenticationOptions as well as anything new added in the future, without requiring new API on ManagedHandler.

In the process of doing that, also added an implemention of HttpClientHandler.ClientCertificateOption for ManagedHandler; previously Automatic was just ignored.

I also removed UseDefaultCredentials from ManagedHandler, as it's ignored and not relevant until additional auth mechanisms are supported.

Commit migrated from https://github.com/dotnet/corefx/commit/ee7d4599ed8ac2bca796cc7627ebf33b75f8b7cb
2018-02-07 19:36:53 -05:00
Stephen Toub 458c3f858c Implement MaxResponseHeadersLength on ManagedHandler (dotnet/corefx#26906)
Commit migrated from https://github.com/dotnet/corefx/commit/b6b7eb09600c18d35c6f9bf9ca484d5b8399f718
2018-02-07 17:58:05 -05:00
Geoff Kizer 9c26603fa8 address review feedback
Commit migrated from https://github.com/dotnet/corefx/commit/7b9be1d656ecba48fdb4082b37a66574c3172a4e
2018-02-07 10:54:12 -08:00
Geoff Kizer 1296d2b3fd add test for connection upgrade
Commit migrated from https://github.com/dotnet/corefx/commit/61eb7b2667465dcc6e4c52829a505d74e51adc4a
2018-02-07 10:54:11 -08:00
Stephen Toub 601553e06d Add Connection{Idle}Timeouts to ManagedHandler (dotnet/corefx#26839)
* Add Connection{Idle}Timeouts to ManagedHandler

We can agree on the final name(s) when going through API reviews.  For now, I chose what I think are easy to understand names:
- ConnectionTimeout: how long a connection is allowed to be reused before it's no longer usable, defaults to infinite
- ConnectionIdleTimeout: how long a connection can sit idle in the pool before it's no longer usable, defaults to 2 minutes (that value was hardcoded before this change)

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/1a5cdbe1af7a5befe16bb4581f29f0af64f4a101
2018-02-07 07:51:10 -05:00
Geoff Kizer 507363f7c1 Merge pull request dotnet/corefx#26782 from geoffkizer/httpmisc2
ManagedHandler: support LF line endings and trailer headers

Commit migrated from https://github.com/dotnet/corefx/commit/ddf2a6d45973d5ceb6b2c9920a23f64094c6da3c
2018-02-07 00:12:58 -08:00
Paulo Janotti 99eb957292 Proper check for OpenSSL version in System.Net.Http.Tests (dotnet/corefx#26873)
Disable the tests affected by dotnet/corefx#26803 in the correct way so tests are skipped only when needed.

Commit migrated from https://github.com/dotnet/corefx/commit/cd26075ef0d371e222ab52a1322ea9a73f07ad72
2018-02-05 21:43:37 -08:00
Paulo Janotti d88807b6d4 Conditionally skip test causing assert in WSL. (dotnet/corefx#26875)
Skip test in WSL until dotnet/corefx#26813 and dotnet/corefx#26476 are fixed

Commit migrated from https://github.com/dotnet/corefx/commit/d9665c946e47dc9a3cf4b4669d73f9d49a752a68
2018-02-05 21:40:59 -08:00
Geoff Kizer e220972236 clean up encoding handling
Commit migrated from https://github.com/dotnet/corefx/commit/3d2f149c5891ee9095de2b50877676b903002147
2018-02-05 11:09:59 -08:00
Dan Moseley 623ba89344 Disable Http test for 26770 (dotnet/corefx#26854)
Commit migrated from https://github.com/dotnet/corefx/commit/8c3ac0912ef40ae98835f3188fa75605210253a8
2018-02-05 10:58:56 -08:00
Geoff Kizer eab53ef4e7 address review feedback
Commit migrated from https://github.com/dotnet/corefx/commit/4103b918249282a40b53e30f7825b9a22a35acff
2018-02-05 10:04:03 -08:00
Paulo Janotti bfd647ca5e Disable Net.Http tests failing in Fedora.27 (dotnet/corefx#26835)
* Disable Net.Http tests failing in Fedora.27 (dotnet/corefx#26803)

* Adding comments for when tracking issue is fixed.


Commit migrated from https://github.com/dotnet/corefx/commit/e9be24d1913af98a671734267c212597fecfea70
2018-02-04 19:45:40 -08:00
Stephen Toub 114398ac6b Disable ExpectContinue in ManagedHandler when using version 1.0 (dotnet/corefx#26774)
Don't fail, but disable sending the header and respecting the setting if the version is 1.0.

Commit migrated from https://github.com/dotnet/corefx/commit/8ec2cf215893c1f86c25bc079ff67e67678e0a04
2018-02-03 06:07:36 -05:00
Tarek Mahmoud Sayed 9a37559457 Enable Stress mode environment variable (dotnet/corefx#26808)
* Enable Stress mode environment variable

To write any stress test, you may mark the stress test case with one of the attributes:

[ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
[ConditionalTheory(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]

and set the value of the environment variable COREFX_STRESS to 1 or true

* apply the stress mode detection on System.Net.Http

* remove un-needed comments


Commit migrated from https://github.com/dotnet/corefx/commit/3d38415b8df3a707834e05830a9f78185ebd7b18
2018-02-03 06:05:59 -05:00
Paulo Janotti 64e492d841 Fix test PostAsync_ThrowFromContentCopy_RequestFails (dotnet/corefx#26794)
* Fix test to catch proper exception according to handler

* Removing test trait added for my local tests

* Uap handler behaves like the managed one

* Switch if branching for simpler condition


Commit migrated from https://github.com/dotnet/corefx/commit/f38afda24305979be4613d08df8ea154a6a2d16d
2018-02-02 19:07:29 -08:00
Tomas Weinfurt ee6b026c39 get connection from pool to send digest auth response (dotnet/corefx#26733)
* get connection from pool to send digest auth response
* fix incorrect comment.
* s/TBD/TODO/


Commit migrated from https://github.com/dotnet/corefx/commit/c727d1226a886a8ac2d2fdef64cc56a8eee7f8f9
2018-02-02 10:15:47 -08:00
Stephen Toub b3286ea024 Clean up ManagedHandler sending of request content (dotnet/corefx#26759)
* Clean up ManagedHandler sending of request content

Centralize the copy into the function that actually sends the content.

* Add HttpClientHandler test for handling request content copy failure


Commit migrated from https://github.com/dotnet/corefx/commit/6f8a600be95671162bd4de3014adafabe0a0e5ed
2018-02-02 08:50:35 -05:00
Geoff Kizer 1869a9d1a1 support LF line endings and trailer headers
Commit migrated from https://github.com/dotnet/corefx/commit/85c943fb8388585a7d49a75b879844d68962a6ab
2018-02-02 01:21:27 -08:00
Stephen Toub 3e942132d9 Fix ManagedHandler env var / AppContext handling (dotnet/corefx#26763)
* Fix ManagedHandler env var / AppContext handling

* Update two names

* Update README.md


Commit migrated from https://github.com/dotnet/corefx/commit/473a4cf05c28f95d8a93b826647f755dbdec8728
2018-02-01 22:04:16 -05:00
Stephen Toub 56fefc7c78 Disable SetDelegate_ConnectionSucceeds on Linux (dotnet/corefx#26773)
Commit migrated from https://github.com/dotnet/corefx/commit/166f2bacd530d658fa889731e5989b89f2aedee4
2018-02-01 20:58:20 -05:00
Stephen Toub bebcb3fe25 Move ManagedHandler version/chunking validation earlier (dotnet/corefx#26766)
Move it to ManagedHandler.SendAsync rather than HttpConnection.SendAsync so that it happens before we even try to get a connection.  A minor benefit of the change as well is that isHttp10 is no longer lifted to the state machine.

Commit migrated from https://github.com/dotnet/corefx/commit/bb738a07720a8c0888a088f2adb737d2cbe09ca2
2018-02-01 20:15:16 -05:00
Stephen Toub 0636603b5c Use TryFormat with spans in a few more places in ManagedHandler (dotnet/corefx#26755)
Commit migrated from https://github.com/dotnet/corefx/commit/2b4664a53d8a5729343f056ffa82ff5cb4d32d40
2018-02-01 20:07:57 -05:00
Stephen Toub dd62c15024 Remove Supports* properties from ManagedHandler (dotnet/corefx#26764)
Commit migrated from https://github.com/dotnet/corefx/commit/c18664d0d55dad41d00193ac182e292c0c6cd458
2018-02-01 20:07:44 -05:00
Geoff Kizer a1337d4869 fix dribble tests when client disconnects on bad request (dotnet/corefx#26730)
Fixes dotnet/corefx#26729

Commit migrated from https://github.com/dotnet/corefx/commit/6f5d255a76a192906f692fd3d2b9104ab6aeb2f2
2018-02-01 06:21:36 -08:00
Geoff Kizer d4cdf4d46d Merge pull request dotnet/corefx#26708 from geoffkizer/httpretry
ManagedHandler: implement connection retry logic

Commit migrated from https://github.com/dotnet/corefx/commit/95bfb895707d5756d4b9693286672780f0a6ba02
2018-01-31 20:24:58 -08:00
Tomas Weinfurt ba0964d681 add proxy configuration based on environment variables on Unix (dotnet/corefx#26341)
* initial attempt

* remove extra debug message and cleanup.

* take feedabck from reviews

* adress comments from review and add unit tests

* add missing variables to cleanup function

* fix more style and review comments

* updates suggested by geoff

* few more places s/Credientials/Credentials/

* refactor credentials handling

* more fixes to address review feedback

* include HttpProxyConnectionHandler.*.cs only for  netcoreapp


Commit migrated from https://github.com/dotnet/corefx/commit/454220d87dc118a6cb039ef5bd68707de20b79a5
2018-01-31 15:46:27 -08:00
Paulo Janotti a9bb9f1ab7 Separate basic auth test cases for HttpClientHandler (dotnet/corefx#26713)
Separating the test cases between compliant and non-compliant names. Related to dotnet/corefx#23135 

Commit migrated from https://github.com/dotnet/corefx/commit/62a3d898ceb94227b2b03462b5b09f0a7cd4e3a8
2018-01-31 15:37:08 -08:00
Geoff Kizer 4db480c02e address review feedback
Commit migrated from https://github.com/dotnet/corefx/commit/87ff7479b35c3df7b1a5381447d89c42e2463bc7
2018-01-31 15:04:18 -08:00
Geoff Kizer 6239288b27 Merge pull request dotnet/corefx#26585 from geoffkizer/httpversionhandling
clean up request and response version handling in managed handler

Commit migrated from https://github.com/dotnet/corefx/commit/2e10ed5418bac7b6b47a407b7efb28ccfcbc9f21
2018-01-31 10:19:41 -08:00
Geoff Kizer 694a7a6172 implement connection retry logic and related changes
Commit migrated from https://github.com/dotnet/corefx/commit/64976bf062b6cbc55a3e708dbf7116188d075ff1
2018-01-31 10:03:23 -08:00
Paulo Janotti 1542b4278f Make redirect test case really 'redirect' (dotnet/corefx#26674)
The test case was redirecting to the same URL this was bringing instability with the handlers (more with the managed). This change should make the test more reliable, as such moving it to inner loop.

Fixes dotnet/corefx#23769
Since no action is planned for dotnet/corefx#26434 this also closes dotnet/corefx#26434

Commit migrated from https://github.com/dotnet/corefx/commit/3b69635f25636377841ded02de254eacec6e3728
2018-01-30 13:26:09 -08:00
Paulo Janotti 8e297658e1 Http protocol dribble tests taking two long (dotnet/corefx#26680)
The time of inner loop is dominated by the http protocol dribble tests.

Returning the Task.Delay to Task.Yield reduces it from ~19 seconds to less than a second on a Windows 10 RS3 box.

Commit migrated from https://github.com/dotnet/corefx/commit/179cf080901f8f7f4e5499b80ad393b7370eef40
2018-01-30 16:06:51 -05:00
Tomas Weinfurt 8492f6e784 merge positive and negative test to one. add more test cases
Commit migrated from https://github.com/dotnet/corefx/commit/6457d8102bc6527b8a5277c7cc4838a497cf2e48
2018-01-29 17:14:05 -08:00
Tomas Weinfurt 3af560535e update from reviews. refactor opaque handling, make realm mandatory and add negative test case.
Commit migrated from https://github.com/dotnet/corefx/commit/dd1d93fc8a25343ab15360e368a0c7d900355c34
2018-01-29 16:26:52 -08:00
Geoff Kizer 5a33c6658b fix CurlHandler test for 2.0 response
Commit migrated from https://github.com/dotnet/corefx/commit/b91b6c63aa3678ba707a9900b64eea9f8e0a6d00
2018-01-29 13:31:18 -08:00