Commit Graph
1082 Commits
Author SHA1 Message Date
David Shulman e813e968b6 Fix SocketsHttpHandler for Windows auth proxy CONNECT tunneling (dotnet/corefx#30478)
SocketsHttpHandler wasn't even trying to send Negotiate/NTLM auth tokens to a proxy. This was due
to some invalid logic regarding the "usingProxy" field in HttpConnection. Reworked this logic to
be clearer about the various kinds of proxy scenarios.

I refactored the loopback proxy server and made it much more robust. It can now handle multiple
requests and multiple connections which helps test against the other handlers whose behavior is
different in this area. I plan to do further work in consolidating the LoopbackServer and
LoopbackProxyServer classes in future PRs.

I created a separate HttpClientHandlerTest.Proxy.cs file and moved many existing proxy tests and
added new tests. The current HttpClientHandlerTest.cs file is still over 3000 lines and needs more
refactoring to make it easier to maintain and track test scenario coverage.

Fixes dotnet/corefx#30330


Commit migrated from https://github.com/dotnet/corefx/commit/ec1671fd7feffe1070a94d9d86379e0dd95ddcdf
2018-06-18 16:21:44 -07:00
David Shulman 11a5740636 Add HTTP/2.0 test server (dotnet/corefx#30309)
To prepare for the work of adding HTTP/2.0 support to SocketsHttpHandler, I deployed a new Azure
server. As with all HTTP/2.0 endpoints, only HTTPS (TLS) is supported.

This server is based on Azure Web Apps instead of Azure Cloud Services (classic). This makes it
easier to scale out and maintain as well as give us a staging environment to validate upgrades to
the test server without affecting the production PR/CI runs.

Although the default for HttpClient/HttpRequestMessage.Version is 2.0, only the older platform handler stacks (WinHttpHandler, CurlHandler, UAP) will send as HTTP/2.0. SocketsHttpHandler is currently just ignoring the version value and using HTTP/1.1 as the request version. When SocketsHttpHandler is modified to support HTTP/2.0, then all default requests by HttpClient will attempt HTTP/2.0. Our existing Azure test server (and loopback server) will still downgrade to HTTP/1.1. But this new test server will use HTTP/2.0.


Commit migrated from https://github.com/dotnet/corefx/commit/58892b9d2d95d6cc3f90811d75248f90e0ff716b
2018-06-12 06:58:04 -07:00
Stephen Toub 6cc996f95c Delete some unused .cs files (dotnet/corefx#30251)
In a few cases, this also highlighted other dead code that could be removed, e.g. a shim export we no longer need. And it highlighted some places where .cs files weren't included in a .csproj but should have been; I've fixed those.

Commit migrated from https://github.com/dotnet/corefx/commit/844415759d3f1525bf1f5d1bd79453c6aa8493f8
2018-06-12 09:46:47 -04:00
Stephen Toub 3756929827 Disable CustomMethod_SentUppercasedIfKnown on UAP (dotnet/corefx#30167)
It's not uppercasing any of them.

Commit migrated from https://github.com/dotnet/corefx/commit/f9ab6c8971c93463aa094f8b1b2e41c522042fa7
2018-06-06 11:32:42 -04:00
Stephen Toub d622ff47d5 Ensure SocketsHttpHandler sends known verbs uppercased (dotnet/corefx#30149)
To behave similarly to netfx and WinHTTP, which ensure some known methods are sent uppercased.  They differ on exactly which, so I've standardized on doing the ones for which HttpMethod has static properties. Since we're paying for this normalization, I've then taken advantage of it to use reference comparisons on the HttpMethod instances where we're later checking for known methods, and I also removed an allocation from HttpMethod's GetHashCode, since we're now storing these in a dictionary which uses GetHashCode.

Commit migrated from https://github.com/dotnet/corefx/commit/02b11fae98fd2d6662e1c490cae8462b0ce1ecdf
2018-06-05 19:12:54 -04:00
Tomas Weinfurt 7af1cdf826 add test for dotnet/corefx#26732 (dotnet/corefx#30124)
* add test for dotnet/corefx#26732
* feedback from reviews


Commit migrated from https://github.com/dotnet/corefx/commit/c56f4cda3ca772108a8de0cf3f5ad65a139e7204
2018-06-04 12:27:55 -07:00
Stephen Toub dc14dd4f44 Fix Expect: 100-continue handling when no request content (dotnet/corefx#30102)
A developer can specify that an Expect: 100-continue header be sent even if there's no request content, in which case SocketsHttpHandler dutifully sends the header.  In response, a server might still send back a 100 continue status line and an empty line (e.g. "HTTP/1.1 100 Continue\r\n\r\n"), and then send back the final response, including another status line, headers, etc.  SocketsHttpHandler isn't expecting the second status line if there wasn't any request content, in which case it ends up misinterpreting everything after the 100 continue status line and empty line as being response body content.  That has many bad side effects, including not parsing any of the actual response headers.  And since it doesn't get any response headers that indicate the response body is of a known content length or transfer-chunk encoded, it believes the response only ends when the connection is closed.  But this is HTTP 1.1, and the server is likely keeping the connection open for reuse, and thus the client hangs.

Commit migrated from https://github.com/dotnet/corefx/commit/909dc9eb3ba829647c45348c85bc9271019c509f
2018-06-02 23:37:09 -04:00
David Shulman ef3c76c2d1 Investigate / skip failing UAP Http tests (dotnet/corefx#30064)
Worked thru most of the tests previously disabled. Opened new issues for a bunch of them
with detailed analysis. Some tests are being permanently skipped due to differences in UAP
platform.

Contributes to dotnet/corefx#29802

Commit migrated from https://github.com/dotnet/corefx/commit/4e91b8620498cc82faafecb619bca630e277d6d3
2018-06-02 09:30:22 -07:00
Stephen Toub 998cdde08b Add test for ExpectContinue with no content (dotnet/corefx#30065)
* Add test for ExpectContinue with no content

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/3ae01e959c3e1789e3620a2d0e843b46c772031b
2018-06-02 08:58:33 -04:00
Martijn Laarman ea0ba1301e Add All enum value to DecompressionMethods (dotnet/corefx#30075)
Fixes dotnet/corefx#29243

Updates the Decompression tests to explicitly use
DecompressionMethods.All

Commit migrated from https://github.com/dotnet/corefx/commit/3c2ce7b352873d2faa088d07b06bc96a00f44e0e
2018-06-02 08:58:01 -04:00
David Shulman 2ed92622d1 Increase timeout for Http cancellation test (dotnet/corefx#30025)
We haven't seen this set of tests fail often. But when they do, it seems to take a little more
than 30 seconds (31 in this failure case) for the operation to cancel. The original "30" second
number was a guess. But based on busy CI machines, we'll increase the number in the hope of
getting less test failures.

Closes # 28805

Commit migrated from https://github.com/dotnet/corefx/commit/81b0f7764d815fcac8b6667d81cc05a25f6ebe99
2018-05-31 17:26:02 -04:00
David Shulman 355c719516 Fix proxy connect tunnel test (dotnet/corefx#30007)
The test was hanging on most handlers except for SocketsHttpHandler. It was hanging because
the await'ed task of connecting to the proxy never happened. Except for SocketsHttpHandler,
the other handlers optimize loopback so that if the destination server is on loopback, then it
ignores any proxy setting. The test was using both a loopback destination server as well as a
loopback proxy server.

This test is one of the few tests that do an end-to-end request/response thru a proxy. So, it's
important that we keep the test and have it work on all handlers. Modified the test to use a real
external server destination. The test still uses a loopback proxy server.

I also moved some of the Outerloop tests to Innerloop since those tests were using loopback.

Fixes dotnet/corefx#27746


Commit migrated from https://github.com/dotnet/corefx/commit/2edbc59c653533c1a0ae91882d482ae148cb92be
2018-05-31 13:17:21 -07:00
David Shulman dfb7ac451c Remove obsoleted comment from SocketsHttpHandlerTest (dotnet/corefx#30020)
Similar to PR dotnet/corefx#29988, testing implementation details of SocketsHttpHandler behaviors
doesn't make sense against the other handlers.

Running HTTP tests generally across all the handlers is useful when we're trying to
validate HTTP protocol and API behaviors to be consistent everywhere.

However, testing SocketsHttpHandler implementation details, such as connection-pooling
algorithms, with other handlers leads to brittle tests with random test failures. The
internal code of each handler and native code (i.e. WinHTTP) use different rules
(timeouts, lifetime, etc.) for such low-level connection details.

So it makes sense to only run tests such as this against the code that was written to
match the tests, i.e. SocketsHttpHandler.

Closes dotnet/corefx#27272

Commit migrated from https://github.com/dotnet/corefx/commit/31f7b653fe62317c7edd5c3fc59430462197934d
2018-05-31 13:52:16 -04:00
David Shulman 2aefe4af59 Only run ResponseDrain tests on SocketsHttpHandler (dotnet/corefx#29988)
Running HTTP tests generally across all the handlers is useful when we're trying to validate HTTP protocol and API behaviors to be consistent everywhere.

However, testing SocketsHttpHandler implementation details, such as connection-drain algorithms, with other handlers leads to brittle tests with random test failures. The internal code of each handler and native code (i.e. WinHTTP) use different rules for such low-level connection details.

So it makes sense to only run tests such as this against the code that was written to match the tests, i.e. SocketsHttpHandler.

Closes dotnet/corefx#28424
Closes dotnet/corefx#28206

Commit migrated from https://github.com/dotnet/corefx/commit/2c734d6db0a8009150bac59f13960f463528ba76
2018-05-30 15:09:26 -07:00
David Shulman f615d5016a Add HttpClient test for sending rewindable content stream (dotnet/corefx#29971)
Issue dotnet/corefx#23782 was opened describing a behavior difference in Linux versus
Windows regarding the final position of a stream after being sent. This
turned out to be a behavior in CurlHandler that we decided to not fix.

This PR adds a test to document the behavior of resending a request body
content object (now possible now since we no longer dispose request content
after send). This test is only validating the default HttpClientHandler
which is SocketsHttpHandler now. It also matches .NET Framework behavior.

Closes dotnet/corefx#23782


Commit migrated from https://github.com/dotnet/corefx/commit/b46045f9132597e1600e3ceafd6bbeb272576a62
2018-05-30 14:18:39 -07:00
David Shulman 6813abda80 Update Http test comment about SSL auth and Host header (dotnet/corefx#29987)
This test is only relevant for .NET Framework and .NET Core with SocketsHttpHandler.

Closes dotnet/corefx#24947

Commit migrated from https://github.com/dotnet/corefx/commit/e02f9e86210d7c39c6ccae7a5bcfd05d510dddb5
2018-05-30 13:25:31 -07:00
David Shulman 8e11e35537 Fix auto decompression behavior in Http handlers (dotnet/corefx#29903)
Fixed a few bugs in both WinHttpHandler and SocketsHttpHandler regarding the behavior of
'Accept-Encoding' request headers and automatic decompression of response body content.

On Windows 7, native WinHTTP doesn't support automatic decompression. That also means it doesn't automatically append 'Accept-Encoding' request headers. WinHttpHandler was relying on WinHTTP to add those headers. But it wasn't happening on Windows 7. So, now WinHttpHandler will make sure those headers are added if not already present. WinHttpHandler was also always decompressing content even when the encodings in the .AutomaticDecompression property didn't match.

SocketsHttpHandler had a different bug. It would make sure that the 'Accept-Encoding' headers were
present when .AutomaticDecompression was being used. But it wouldn't check for existing headers and duplicate encodings would be present in the outbound 'Accept-Encoding' request header.  I.e., it would end up with "Accept-Encoding: gzip, gzip".

In addition to fixing these bugs, I added more tests to both Http Functional and WinHttpHandler Unit
tests (which can simulate running on Windows 7 using the existing mocks).

Fixes dotnet/corefx#29747
Fixes dotnet/corefx#26991


Commit migrated from https://github.com/dotnet/corefx/commit/40ce4cb20270f731d7d826291e1edce8d1ce2c37
2018-05-25 14:48:26 -07:00
Stephen A. Imhoff fb1798288f Consolidate http date parsing (dotnet/corefx#28843)
* Add implementation to common

* Shift System.Net.Http to use common HttpDateParser

* Clean up whitespace in affected areas of System.Net.Requests

* Update System.Net.Request to use common Http date parsing

* Switch to InvariantCulture in tests

* Specify type.

* Remove unneeded file.

* Remove unneeded parameter

* Don't cache parameters.

* Let 'r' be handled like in System.Net.Http

System.Net.Http handled the 'r' format by letting a format string that didn't require leading zeros to be used, meaning one format string can be removed from consideration.


Commit migrated from https://github.com/dotnet/corefx/commit/deee13b99d441cf1906397c54d0c5afcf8385d92
2018-05-24 10:39:16 -04:00
David Shulman 698cedb4c0 Fix HttpClient TLS tests (dotnet/corefx#29851)
Native WinHTTP sometimes uses multiple TCP connections to try other TLS protocols when
getting TLS protocol failures as part of its TLS fallback algorithm. The loopback server
doesn't expect this and stops listening for more connections. This causes unexpected test failures.

I confirmed this investigation comparing with a non-loopback server and WireShark traces. I discussed
this with the WinHTTP team.

SocketsHttpHandler, which uses SslStream for TLS, is able to optimize this and looks directly at
the TLS server-hello to determine if the connection is going to be compatible with the allowed client
TLS protocols. So, it doesn't use multiple TCP connections to determine a final failure outcome.

I also cleaned up the test code removing duplicate tests.

Fixes dotnet/corefx#8538

Commit migrated from https://github.com/dotnet/corefx/commit/226b225df8873b5c7a79d027119871834b24a7d4
2018-05-22 12:37:49 -07:00
Stephen Toub 9aa30c9d3d Fix SocketsHttpHandler handling of pooling timeouts with max connections (dotnet/corefx#29822)
* Fix SocketsHttpHandler handling of pooling timeouts with max connections

Fixes two cases:
1. When a pooling timeout (lifetime or idle) is set to 0, we fail to enforce the MaxConnectionsPerServer limit.
2. When MaxConnectionsPerServer is set and the limit is reached, when a request completes and we transfer the connection from the completing request to a waiting request, we fail to check / enforce the connection lifetime limit.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/50e30118b37db1c3a48a0920e670b9ca5f9631d4
2018-05-22 11:32:10 -04:00
David Shulman e7ae16d343 Disable Http tests on UAP (dotnet/corefx#29803)
Many dozen of Http tests are failing on UAP test runs. This is not showing up during PR/CI
because the UWP leg only is building the product and test sources and not actually running
any tests. However, the test failures show up in Helix and also when run locally on a dev machine.

So, for now, I'm disabling some of these tests so that the inner and outer test runs will pass.

Contributes to dotnet/corefx#29802
Closes dotnet/corefx#27953

Commit migrated from https://github.com/dotnet/corefx/commit/3326f3f24dd083f0966c8f71c7d1e8c2caa1ddae
2018-05-20 09:33:35 -04:00
David Shulman 0de1bd3ee8 Change EnsureSuccessStatusCode to not dispose response content (dotnet/corefx#29795)
* Change EnsureSuccessStatusCode to not dispose response content

Historically, this method has always disposed the response content if it was
throwing an exception. The reason documented in the comment really doesn't
make much sense, especially to just dispose the content but not the actual
response object. The developer pattern we advise when getting an HttpResponseMessage
is to wrap it in a 'using' statement or use an explicit .Dispose() call. And
disposing the HttpResponseMessage would always dispose the inner .Content
anyways.

The use case of dotnet/corefx#26684 is that the response content should be available regardless
if this method throws an exception or not. Developers normally don't expect an object
to get disposed (partially in this case) as a side-affect of calling a method on the
object. So, we're changing the behavior to be more consistent generally with other
.NET objects.

Fixes dotnet/corefx#26684

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/b0e049cc3db252129a36648780cf78cb0641afbf
2018-05-19 13:01:12 -04:00
David Shulman a6af7cfd24 Fix client certificate lifetime handling in tests (dotnet/corefx#29758)
* Fix client certificate lifetime handling in tests

This was a difficult bug to track down. Our use of importing PFX files into the
tests has problems due to a combination of issues. The summary is that these
issues cause the private key (which is written to a temp file on disk) to get
corrupted/deleted. This is why we would get random errors about "invalid client
credentials" when using client certificates in HttpClient (or SslStream).

Thanks to @bartonjs for helping me work thru this.

The lifetime of the temp file containing the private key is associated with the managed
X509Certificate2 object that is created. However, our use of X509Certificate2Collection
followed by the use of the .Find() API in
[GetEligibleClientCertificate](https://github.com/dotnet/corefx/blob/dotnet/corefx@10aa8277de2521fb1e6a5b42d053ad8cc947be81/src/Common/src/System/Net/Security/CertificateHelper.cs#L55-L59)
causes new managed objects to get created including both a new collection object and
new certificate objects wrapping the existing native PCCERT_CONTEXT of the old managed
certificate object. This causes lifetime issues for the temp file containing the private
key since the old managed objects are GC'd.

In terms of fixing this for the tests, I've optimized the Configuration.Certificates
helper and removed constructs that we don't actually use in our tests. Switching from
using .Import() on the collection object to actually creating the X509Certificate2
object directly helps with managing the lifetime of the certificate.

I will be doing a follow-up PR to optimze GetEligibleClientCertificate() to switch from
using .Find() and instead directly query the certificates in the original collection.
This will result in less managed objects being created as well as avoid additional private
key lifetime issues for certificates imported that use the default X509KeyStorage.DefaultKeySet
flags.

I also fixed a problem with the test which was always failing on NETFX.

Closes dotnet/corefx#9543

* Remove Mutex


Commit migrated from https://github.com/dotnet/corefx/commit/75ba6cd878b6764e1f400c839271866f7d2a049a
2018-05-17 10:46:18 -07:00
Stephen Toub 707aceaacc Add Brotli support to SocketsHttpHandler (dotnet/corefx#29729)
* Add Brotli support to SocketsHttpHandler

- Add DecompressionMethods.Brotli
- Add support for Brotli to SocketsHttpHandler
- Add some tests

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/91f2cd7e3de0c4eab799e4d946b1d50c4d15d930
2018-05-16 21:40:53 -04:00
David Shulman bfad67798e Disable test on NETFX (dotnet/corefx#29743)
This newly added test was always failing in NETFX (Outerloop).

.NET Framework has always had a limitation and cannot resolve DNS names with Unicode since it is p/invoking into the 'A' and not 'W' version of the native APIs. The workaround for developers is to use punnyname for the DNS name.

This is currently being tracked with internal bug 125570.

Commit migrated from https://github.com/dotnet/corefx/commit/8ab4f2c1b3bddf79ea3d206a0fec8444f0af167a
2018-05-16 12:18:52 -07:00
David Shulman 2ae1d2c874 Update System.Net tests to use newer corefx-testdata PFX files (dotnet/corefx#29724)
Updated PFX files were checked into corefx-testdata repro via
https://github.com/dotnet/corefx-testdata/pull/24. This PR removed
the friendly name attribute from the private key. This fixes the
problem in Windows dealing with parallel PFX import.

This PR updates the System.Net.* tests to use the updated corefx-testdata package.

Closes dotnet/corefx#23341
Contributes to dotnet/corefx#9543

Commit migrated from https://github.com/dotnet/corefx/commit/84883052ef0f720a8befdc8525db50c9544227d5
2018-05-16 11:42:46 -07:00
Caesar Chen a13f0cb9bd Fix a test and add a argument check for DiagnosticsHandler (dotnet/corefx#29701)
* fix test and add a check for DiagnosticsHandler

* address feedback

* improve comment


Commit migrated from https://github.com/dotnet/corefx/commit/cda3d63089ec3e1e4d51d635da444b7319b98440
2018-05-15 10:47:07 -07:00
Stephen Toub 25edfafe0e Fix TaskContinuationOptions => TaskCreationOptions in test (dotnet/corefx#29667)
Commit migrated from https://github.com/dotnet/corefx/commit/1b5782d29d18f96c20d26e5c8f2844f5d082c887
2018-05-11 18:44:31 -04:00
Stephen Toub f3656cb566 Use shared StringBuilderCache (dotnet/corefx#29657)
Commit migrated from https://github.com/dotnet/corefx/commit/03df812785e99885efde06a0f88d82578955276e
2018-05-11 17:39:06 -04:00
David Shulman 264474f8a3 Removed duplicated type HttpVersionInternal (dotnet/corefx#29545)
Removed duplicated type HttpVersionInternal

We added HttpVersionInternal back when it differed from the System.Net.Primitives HttpVersion type. But now that the two types are the same, we can remove the duplicated internal type.

Fixes dotnet/corefx#26492


Commit migrated from https://github.com/dotnet/corefx/commit/40faa4ed5c699e84afbb78f6ff96feb7b99db320
2018-05-07 14:00:19 -07:00
Stephen Toub c8e7b2312b Add missing awaits to XmlTextReaderImplAsync (dotnet/corefx#29518)
* Comment on awaits that don't need ConfigureAwait(false)

- Add comments to several awaits on tasks where ConfigureAwait is unnecessary for a variety of reasons
- Rather than commenting, change one await to GetAwaiter().GetResult() where we know the task is already completed (rather than just commenting to that effect)

* Add missing awaits to XmlTextReaderImplAsync


Commit migrated from https://github.com/dotnet/corefx/commit/b758c3b1f1293ada2e46f9e221be0b392838cc41
2018-05-04 16:08:59 -04:00
Caesar Chen f902f3ef5f Unify setting null CookieContainer behavior on HttpClientHandler (dotnet/corefx#29337)
* unify set null CookieContainer behavior

* address test issue, and address feedback

* disable a test


Commit migrated from https://github.com/dotnet/corefx/commit/e30a7494292f3e6e66c0d152ad3240fa1f6dc766
2018-05-03 14:32:32 -07:00
Caesar Chen b2d22149da miscellaneous fix (dotnet/corefx#29492)
Commit migrated from https://github.com/dotnet/corefx/commit/38ad17100349ef286edeb67ddffe4c44ba4e51e1
2018-05-03 14:31:45 -07:00
Stephen Toub 7580bf003a Delete Brotli_External_DecompressesResponse_Success test (dotnet/corefx#29486)
We have Brotli_DecompressesResponse_Success which just uses a loopback server.  I'd added Brotli_External_DecompressesResponse_Success as a way to test against another Brotli implementation, but that's not really something we need to do in the System.Net.Http tests; rather, it's up to the System.IO.Compression.Brotli tests to ensure compliance.  Given that, and this tests ends up causing failures when httpbin.org goes down, I'm just deleting it.

Commit migrated from https://github.com/dotnet/corefx/commit/e85573f9b778ba65925f17da6fc485bb43d2c055
2018-05-03 15:01:39 -04:00
Stephen Toub b9397a45ca Add two missing ConfigureAwait(false) calls in SocketsHttpHandler (dotnet/corefx#29465)
* Add two missing ConfigureAwait(false) calls in SocketsHttpHandler

ChunkedTransferEncodingReadStream's ReadAsync had one await missing a ConfigureAwait(false).  If there's a synchronization context set on the calling thread, this results in a continuation being created that posts back to that context, which can cause problems (e.g. deadlocks) if that context is blocked, e.g. if the synchronous Read method is being used to block waiting for ReadAsync to complete.  The fix is simply to add `.ConfigureAwait(false)`.

As long as I was fixing that, I also reviewed all `await`s in SocketsHttpHandler and found one more that was missing `.ConfigureAwait(false)`, in HttpConnectionPool's EstablishProxyTunnel, and so fixed that, too.

And added some tests.

* Refactor ContentMode support in tests


Commit migrated from https://github.com/dotnet/corefx/commit/9e8c200f0888a1db590da8ffa026aa7384771611
2018-05-02 19:24:56 -07:00
Stephen Toub e065edbe62 Re-enable the SocketsHttpHandler microbenchmarks (dotnet/corefx#29317)
The perf tests were wholesale disabled due to port exhaustion errors.  Those errors are just coming from the "connectionPerRequest" tests, which are inherently flawed in this regard, so I've just deleted them.

Commit migrated from https://github.com/dotnet/corefx/commit/d3b3d2daafe135684f7d77438dfe7d42f4f4baf8
2018-04-26 17:10:53 -07:00
José Rivero 06e5d2213a Disabling benchmark due to issue dotnet/corefx#29308 (dotnet/corefx#29309)
- Increasing the timeout on perf.groovy
  (Running profile and diagnostic runs takes over the default of 4 hours.)

Commit migrated from https://github.com/dotnet/corefx/commit/e4e6873b04470e78a9fc0138815b86d364edfa58
2018-04-24 18:24:58 -07:00
Stephen Toub d5ba24bff1 Several Http test fixes to hopefully improve test reliability (dotnet/corefx#29238)
- Add “Connection: close\r\n” response header in more cases where the loopback server explicitly closes a connection, and in particular where the client makes multiple connections.
- Change several Task.WaitAlls on paired tasks to instead use our WhenAllOrAnyFailed helper.

Commit migrated from https://github.com/dotnet/corefx/commit/cebcf436358600a4808656b142a74f57d1e8f6f0
2018-04-20 18:21:18 -04:00
Paulo Janotti c3a6cbaea6 More SSL error queue cleaning (dotnet/corefx#29171)
* Cleaning up more instances leaving errors on SSL queue

* Fixes dotnet/corefx#25676

Commit migrated from https://github.com/dotnet/corefx/commit/c0083e09903f3d1aa23598beeae5aafbdd433f1f
2018-04-18 08:52:53 -07:00
Marco Rossignoli 528e91dabf Replace identical files with CoreLib mirror (dotnet/corefx#28593)
Commit migrated from https://github.com/dotnet/corefx/commit/5041dbb272ae05b360db538cf62fc2847277fd7e
2018-04-17 16:05:44 -07:00
Marco Rossignoli 20e05bb5cd Pass Uri.IdnHost to WinHttpConnect (dotnet/corefx#28849)
* pass IdnHost

* add manual functional test

* cleanup

* fix comment

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* fix IPv6 IdnHost

* address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/b2893f07cf61dae81d424dd676a0d903a36a10c2
2018-04-17 09:55:34 -07:00
Stephen Toub 975f40acce Add basic GET SocketsHttpHandler perf tests (dotnet/corefx#29105)
* Add basic GET SocketsHttpHandler perf tests

Tests for:
- http vs https
- connection: close vs keep-alive
- chunked vs content-length response
- various response lengths

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/27149e4a86ba5827229b8294f1dd19f3f7d58184
2018-04-14 12:31:58 -04:00
Caesar Chen 7669319f3f SocketsHttpHandler: Add workaround for ipv6 LLA address (dotnet/corefx#28971)
* add workaround for ipv6 LLA address

* address comment

* fix comment


Commit migrated from https://github.com/dotnet/corefx/commit/0698997390ddc15abb375eba73a5d712ccdb8266
2018-04-13 17:34:32 -07:00
Max Kerr 7a12691e93 Disable SSL3 test case on RedHat 6 (dotnet/corefx#28998)
Commit migrated from https://github.com/dotnet/corefx/commit/5411a5c72920e1fac7e6315aad0ec302de0d1c55
2018-04-12 09:07:37 -07:00
Krzysztof Wicher c2f3338220 Handle User-Agent/Server writing similarly to HttpHeaders.GetHeaderString (dotnet/corefx#28994)
* Handle User-Agent/Server writing similarly to HttpHeaders.GetHeaderString

* add a testcase and comment for user-agent writing

* apply feedback

* further simplify test

* Update HttpClientTest.cs


Commit migrated from https://github.com/dotnet/corefx/commit/b703f310d5330bad7ae4b571175f259a3a1bc4b0
2018-04-11 01:37:40 -07:00
Ahson Khan eda3bb8370 Fix ROM Content Test to use IMemoryOwner instead of MemoryManager (dotnet/corefx#28947)
Commit migrated from https://github.com/dotnet/corefx/commit/79797279e2e293beb5d9ff60672e4d56cf7c02de
2018-04-10 13:21:11 -07:00
Caesar Chen 3aab539b89 Fix proxied ipv6 address request formatting and fix port handling for proxied IP address on SocketsHttpHandler (dotnet/corefx#28740)
* fix proxied ipv6 address request format and fix port handling for ip address

* address feedback

* change naming for test data


Commit migrated from https://github.com/dotnet/corefx/commit/18d685f3b1ed8fd22601fb0bce3eb928f1c4206f
2018-04-05 15:17:20 -07:00
Paulo Janotti 9365b6fb44 Re-enable PostAsync_RedirectWith307_LargePayload dotnet/corefx#23768 (dotnet/corefx#28828)
Fixes dotnet/corefx#23768

Commit migrated from https://github.com/dotnet/corefx/commit/28dcece5c5e7d30446ae90e027076722513b716f
2018-04-04 16:54:06 -07:00
Max Kerr 6d31e9d045 Improve parsing of WinINet default proxy strings in SocketsHttpHandler (dotnet/corefx#28671)
This is a partial fix for dotnet/corefx#28603.

Commit migrated from https://github.com/dotnet/corefx/commit/22e88da0b430d16def339e52891acf0e0563dbf6
2018-04-04 11:26:29 -07:00
Stephen Toub 3f56012599 Disable draining test on CurlHandler (dotnet/corefx#28814)
Commit migrated from https://github.com/dotnet/corefx/commit/0a61dafdf643f436373c1ad1aba3da4a9a8b19bc
2018-04-04 11:22:40 -07:00