Commit Graph
1074 Commits
Author SHA1 Message Date
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
Stephen Toub 6c551076f0 Make default SocketsHttpHandler SslProtocols include Tls11/12 on Win7/2008R2 (dotnet/corefx#28788)
Windows 7 and Windows 2008 R2 support TLS 1.1 and 1.2, but for legacy reasons by default those protocols are not enabled when a developer elects to use the system default.  However, in .NET Core 2.0 and earlier, HttpClientHandler would enable them, due to being a wrapper for WinHTTP, which enabled them.  Both for compatibility and because we prefer those higher protocols whenever possible, SocketsHttpHandler also pretends they're part of the default when running on Win7/2008R2.

Commit migrated from https://github.com/dotnet/corefx/commit/0c7a1de0448c9dee76723d0bedd90f76c3436662
2018-04-04 09:59:09 -07:00
Caesar Chen 109d0485aa disable test (dotnet/corefx#28789)
Commit migrated from https://github.com/dotnet/corefx/commit/e4521cbd572764f3a140366cce7b39402e1a14cc
2018-04-03 16:49:01 -07:00
Stephen Toub fcb85a56d7 Fix ProxyExplicitlyProvided_DefaultCredentials_Ignored test (dotnet/corefx#28770)
I couldn't get it to fail locally, but I believe the issue was that sporadically WinHttpHandler would not reuse the original connection, in which case it would either not close the first and the test would hang because nothing was accepting the second connection, or it would close the first and fail because the server was expecting a second request on the connection.  This fixes it by using Connection: close on the first response so that the client won't reuse the same connection.

Commit migrated from https://github.com/dotnet/corefx/commit/586cffcdfdf23ad6c193a4bf37fce88a1bf69508
2018-04-03 09:00:59 -07:00
Tomas Weinfurt ff137b9fba add proxy bypass list processing for windows (dotnet/corefx#28210)
* add bypass list processing

* remove 10.37.129.2

* update assembly references

* add bypass list processing

* remove 10.37.129.2

* update assembly references

* use Regex.Escape to escape . and [. Add more test cases.

* feedback from reviews

* fix some of the style comments. more changes to come.

* feedback from @stephentoub

* use UriHostNameType and IdnHost consistently to possibly avoid allocations. Add new test for various unexpected input

* replace String.Compare with string.Compare


Commit migrated from https://github.com/dotnet/corefx/commit/c9d1ec1764f421f35cfe0bbc71bf2f81bc8f0f8d
2018-04-02 13:45:51 -07:00
Caesar Chen 0ffc020ac5 Fix ipv6 address format in Host header (dotnet/corefx#28578)
* fix ipv6 format in host header

* address feedback

* address feedback

* fix common case

* reduce allocation

* address feedback

* fix indexof issue

* disable on curlhandler

* revert to simple fix

* address feedback and add comment

* address test issue, enable on curlhandler

* fix framework failure

* address feedback


Commit migrated from https://github.com/dotnet/corefx/commit/24889e293731f12b11f1205b641cd3e6cb3a3b90
2018-04-02 11:26:29 -07:00
Stephen Toub 40573ec3da Disable frequently failing GetAsync_SupportedSSLVersion_Succeeds test
Commit migrated from https://github.com/dotnet/corefx/commit/031e40a64bd7a148f43e5a49055abbf5743b4543
2018-03-31 01:01:45 -04:00
Stephen Toub fd20c03b0c Stop blocking explicit opt-in to Ssl2/3 in SslStream and HttpClient (dotnet/corefx#28639)
By default, .NET Core defaults to allowing TLSv1, TLSv1.1, and TLSv1.2.  However, whereas .NET Framework allows a developer to opt-in to SSLv2/SSLv3, .NET Core currently blocks it.  This means developers are unable to use .NET Core when they need to communicate with an endpoint they don't control and that's unfortunately limited to one of these protocols, which blocks adoption of .NET Core.

This commit stops blocking these protocols.  They're still disabled by default, and compiling against them still results in a deprecation warning, but if a developer chooses to ignore the warning and explicitly sets SslProtocols, they are at least able to use the protocols, subject to whatever the underlying operating system allows (e.g. Windows stops supporting SSLv2 as of v1607).

Commit migrated from https://github.com/dotnet/corefx/commit/3cc6fda0c6abe76eea222c165ebdf816e83df564
2018-03-30 22:00:37 -07:00
Ahson Khan fc292cfab0 Split OwnedMemory into MemoryManager and IMemoryOwner (dotnet/corefx#28640)
* Update IRetainable, OwnedMemory, and MemoryHandle APIs

* Split OwnedMemory into MemoryManager and IMemoryOwner

* Update ReadOnlySequence, ArrayMemoryPool, and BufferSegment

* Update System.Memory and System.IO.Pipeline tests

* Temporarily skipping the failing Pipelines tests until impl is corrected.

* Update the reference assembly to match implementation and cleanup

* Update API compat baseline for UAPAOT and add GenFacadesIgnoreMissingTypes

* Fix the System.Runtime ref

* Add back the Pin methods to the uapaot api compat baseline

* Clone the API compat baseline from uapaot and add it for uap as well.

* Update BuildTools, CoreClr, CoreFx, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to preview3-02630-01, preview3-26330-08, preview3-26330-06, preview3-26330-04, beta-26330-00, beta-26330-00, respectively

* Fix pipelines tests and update the api compat baseline shim for uapaot

* Add empty Unpin override to pipe pool test.

* Fix the System.Net.Http Functional tests


Commit migrated from https://github.com/dotnet/corefx/commit/f592e887e2349ed52af6a83070c42adb9d26408c
2018-03-30 14:30:48 -07:00