Commit Graph
346 Commits
Author SHA1 Message Date
stephentoub cd7f206733 Port Cookie changes to Http's cookie.cs
Per PR feedback.


Commit migrated from https://github.com/dotnet/corefx/commit/01e5c74e5d671ebb65035bc83a556ac9760d0a70
2016-03-28 22:46:55 -04:00
Stephen Toub 1b313893c6 Merge pull request dotnet/corefx#7282 from stephentoub/cbt_curl
Ensure CurlHandler sets CBT even on fast verification path

Commit migrated from https://github.com/dotnet/corefx/commit/f4e984567acfb1672ba023110fdf6db5f34260b4
2016-03-27 08:27:04 -04:00
stephentoub 753c12bd76 Ensure CurlHandler sets CBT even on fast verification path
When we get called back by libcurl to verify the server's certificate, we try to take a fast path where we use OpenSSL's certificate verification rather than doing our own, which is more comprehensive but also slower.  However, when we added that fast path, we inadvertently ended up not setting the Channel Binding Token in that case, only doing so in the fallback path.  This fixes that, moving the configuring of the CBT up to before we ask OpenSSL to verify the cert.


Commit migrated from https://github.com/dotnet/corefx/commit/bb26ba8b5375e76d00db8b371abb6e273e7b4019
2016-03-26 22:36:02 -04:00
Stephen Toub c3b17bf861 Merge pull request dotnet/corefx#7266 from stephentoub/channelbinding_alloc
Lazily allocate ChannelBinding in CurlHandler

Commit migrated from https://github.com/dotnet/corefx/commit/ef6bac6ecc0a7bd3df0daee6b1eeec5a091f5a8b
2016-03-26 22:25:31 -04:00
stephentoub 63c1aa88e7 Avoid creating CurlChannelBinding description until needed
Today CurlChannelBinding creates the result of ToString when the token is set into it.  Getting the description of the binding is rare compared to setting a token into the binding, so just create the string when it's requested.

Also a bit of miscellaneous cleanup in related code.


Commit migrated from https://github.com/dotnet/corefx/commit/49c31a87c41c326788162b7aa148b01f1d89c796
2016-03-26 07:59:48 -04:00
stephentoub 92156d0a5d Lazily allocate ChannelBinding in CurlHandler
This SafeHandle is only needed when using HttpContent-derived types that care about TransportContext, which is not a common case.  Lazily-allocate it.

Just as an example, before this change, it was being allocated during ~50 tests.  After this change, it's allocated just once, in the test explicitly verifying the binding.


Commit migrated from https://github.com/dotnet/corefx/commit/900a3664cf4c574e26144b3cf46db2bcf93fe394
2016-03-26 07:00:19 -04:00
stephentoub aa64955b41 Update packages to rc3-23925-00
Commit migrated from https://github.com/dotnet/corefx/commit/268eea1b538fa80a0042a1eabc4e51c84473d7b0
2016-03-25 20:23:47 -04:00
chcosta 3ca970db0f Merge pull request dotnet/corefx#7249 from chcosta/snh_rid
Update PTR to Unix for System.Net.HTTP

Commit migrated from https://github.com/dotnet/corefx/commit/2dfc9536b6725880ac1804187834aefcd0f96213
2016-03-25 15:04:57 -07:00
stephentoub 11bb3f3c94 Remove and replace some stale [ActiveIssue(...)]
Remove some stale [ActiveIssues] where the tests now pass.

Replace some others with [PlatformSpecific], where the behavior is deemed to be "by design" / accepted.

And update a few issue numbers.


Commit migrated from https://github.com/dotnet/corefx/commit/9c13b0c9389189d86fb2d270c28660946b3ae80c
2016-03-25 15:24:49 -04:00
Christopher Costa 55db55ebd9 Update PTR to Unix for System.Net.HTTP
Commit migrated from https://github.com/dotnet/corefx/commit/fe7b507aee4b268d52ff025c1a05643aac360806
2016-03-25 10:14:51 -07:00
stephentoub 57672b1925 Add assert for status code to cookies test
This test failed once, and I expect it was just due to a network blip that caused the request to fail, but since we're not currently checking the http status code, I can't be sure.  As such, I'm just adding another assert for the expected status code, and if this repros again, we'll know whether that's the issue.


Commit migrated from https://github.com/dotnet/corefx/commit/50b2ce5699eb7034a033b3d125ad62bf03b23458
2016-03-24 19:07:44 -04:00
stephentoub e91101e062 Add tests for certificate revocation and non-OpenSSL backend
Commit migrated from https://github.com/dotnet/corefx/commit/9d4347b5bdca817937dea602f452df3fc2e9e2f3
2016-03-23 16:42:05 -04:00
stephentoub e9e2575810 Change http shim to support getting better version info
Currently the shim exposes a single method to get just the information that was needed when this was written.  Every time we need to get additional version info, we need to change the existing signature (which won't version well) or add additional similar signatures (will which be confusing).  Instead, I've changed it to have more fine-grained entrypoints, each exposing a particular piece of info.  We may end up making a few more interop calls on first-use, but the overhead is negligable.

With that scheme, I've then exposed additional entrypoints for getting version information, in order to provide better tracing and exception error messages.

This is then also used in tests to only run tests when certain features are available.


Commit migrated from https://github.com/dotnet/corefx/commit/29b0dc7b810776178bf42851064c397e47c4d0b8
2016-03-23 14:10:36 -04:00
stephentoub 436bbdf105 Add HttpClientHandler tests for server certificates
Commit migrated from https://github.com/dotnet/corefx/commit/65a4486bfe44c633c2e4dad6dabc6688bea16cc2
2016-03-23 14:10:19 -04:00
stephentoub 3495cb91d4 Fix SSL settings when server callback registered
Setting VERIFYPEER to 0 not only tells libcurl/OpenSSL not to do verification of the peer, but also to ignore any failures from our callback.

Also add a check for revocation checking and throw a PNSE if the backend doesn't support us registering the necessary callback.


Commit migrated from https://github.com/dotnet/corefx/commit/e3a4845289edf4ffa3f4da41efff52e3f6363c6c
2016-03-23 14:09:44 -04:00
stephentoub 0de8ee2b33 Update packages to rc3-23923
Commit migrated from https://github.com/dotnet/corefx/commit/123180cde4aadbed151ffbc00c09b85b7532da68
2016-03-23 11:56:57 -04:00
Eric StJohn 02af87b7e8 Merge pull request dotnet/corefx#7014 from ericstj/xamarinAsFrameworkReference
Add-ref 1:1 assemblies on Xamarin

Commit migrated from https://github.com/dotnet/corefx/commit/181e6331d98acbf976ace048c63101feec0f612f
2016-03-22 11:33:27 -07:00
Eric St. John db01546613 Temporarily revert implementation assembly version to match package version
I made a previous change to decrement assembly versions to enable our packages to be consumed
in desktop and redistribute netcore50 assemblies: https://github.com/dotnet/corefx/pull/6902

That caused a lot of runtime breaks because folks who were built against old packages would
get ref-def mismatches at runtime.  Rather than keep everything broken until the whole stack
updates I'm moving the implementation assemblies back to the old versions.  This will let folks
move to the new packages with the lower versioned ref-assemblies.  Once everyone is on the new
packages we can undo this change.

Change is going directly into TFS to make tonight's build.  I will deal with the fallout during mirror.

[tfs-changeset: 1588328]


Commit migrated from https://github.com/dotnet/corefx/commit/0f268ed1079c182d71cdf49cde3f339a01d67863
2016-03-22 06:47:57 -07:00
Stephen Toub 3ffda29b90 Merge pull request dotnet/corefx#7060 from stephentoub/curl_certs
Implement several certificate properties on CurlHandler

Commit migrated from https://github.com/dotnet/corefx/commit/42857d83882be72db269c14d83345f9a5e740cb6
2016-03-21 16:20:43 -04:00
stephentoub 5c548a386c Address PR feedback, and misc cert-related improvements
- Disable libcurl's cert verification when we're going to do it all ourselves
- Disable application policy for the single-cert manual case
- Avoid allocating a List when a simple array suffices
- Avoid an array allocation when a stack handle is invalid
- Dispose of a chain when Build fails in client callback
- Dispose of chain and certificate in client callback
- Avoid explicitly throwing an exception across an interop boundary when an invalid SSL pointer is provided
- Use named return constants in client callback for readability
- Dispose of certificates retrieved from store
- Remove some unnecessary code in GetRequestCertificateAuthorities


Commit migrated from https://github.com/dotnet/corefx/commit/027eb1e0dbac9bfa1c9b925fcf84e0566372d916
2016-03-21 12:44:20 -04:00
stephentoub 7754902596 Implement several certificate properties on CurlHandler
Adds implementations for:
- ClientCertificates
- ServerCertificateValidationCallback
- CheckCertificateRevocationList

I've explicitly not added these to the contract, as we're not ready for that yet on other platforms, and I've not added tests (though I've done some testing manually, such as verifying that I could run tweaked versions of the WinHttp server callback tests against this successfully).


Commit migrated from https://github.com/dotnet/corefx/commit/8376a43a5c425cc78dfb94c53b6f100eb5146aca
2016-03-21 12:44:19 -04:00
stephentoub b60997fa74 Update packages to rc3-23921
Commit migrated from https://github.com/dotnet/corefx/commit/3eb508d41d476e4ca0c74d106584c7a7f0d51a17
2016-03-21 12:10:10 -04:00
Jon Hanna 1c58a2a42a Fix multiple typos [5]
Commit migrated from https://github.com/dotnet/corefx/commit/00a0871c5cc4ff6af7f036946eef48644ed1e27d
2016-03-20 19:15:44 +00:00
Eric St. John 6aeccb0bae Fix tests to restore using the latest packages
We removed the lifting from the lineup so tests should reference the
latest packages in order to ensure an implementation is available.

The latest pacakges exclude implementation dependencies so I needed to
add these to projects that were depending on them coming in transitively.


Commit migrated from https://github.com/dotnet/corefx/commit/bef9061fd1238adf47b864d8924d121e4134465b
2016-03-19 08:01:11 -07:00
Eric St. John d28646e6b3 Fix restore errors in source projects
The latest drop of packages no longer includes lifting entries in the
lineup.  This causes errors when restoring for a concrete TFM and no
implementation assembly is in the packages.

I addressed this issue two ways:
1. In places where we were targeting a concrete TFM but packaging as
 NETStandard, just target NETStandard instead.
2. In places where we were targeting a concrete TFM but that packages
were missing the implementation on that TFM, update the reference to
newer package version where implementation is available.


Commit migrated from https://github.com/dotnet/corefx/commit/dfb30176c6056f5b3427515c4444a9dc31b9ba4f
2016-03-19 08:01:10 -07:00
Eric St. John ff75367f93 Update packages to rc3-23918
Commit migrated from https://github.com/dotnet/corefx/commit/d3d217b2ab336b862c27a3e605e32dc0c0a6d472
2016-03-19 08:01:09 -07:00
Kevin Jones c428584581 Fix typo in file name.
Commit migrated from https://github.com/dotnet/corefx/commit/af8c01f507c9227a8a11fb752c7df2142f7b4044
2016-03-18 12:45:24 -04:00
Eric St. John 1586e36fed Add-ref 1:1 assemblies on Xamarin
Microsoft.CSharp, System.IO.Compression, and System.Net.Http are all
reference assemblies in the desktop and mono/xamarin targeting packs.
As such these won't be referenced automatically.  Ensure we add a
reference when installing the package.


Commit migrated from https://github.com/dotnet/corefx/commit/eedef71bc2f4fe040ce10a5a59d385b036d3375f
2016-03-17 17:20:57 -07:00
stephentoub 1cbe15bf38 Query for the right proxy creds in HttpClient
Both the WinHttp and libcurl implementations are using the target Uri to lookup the right proxy credentials rather than using the proxy's Uri.


Commit migrated from https://github.com/dotnet/corefx/commit/d0cc5116a9906834f5ebd1813c9b9eed68ea054b
2016-03-17 10:34:06 -04:00
Eric St. John b134ef2308 Ensure stable assembly ref versions.
Make sure that all of the projects that consume API versions
decremented by
https://github.com/dotnet/corefx/pull/6902/commits/dotnet/corefx@716bb82ed9eb75a5a1e9beb0472d403177cff53f
reference the decremented assembly version.


Commit migrated from https://github.com/dotnet/corefx/commit/fe5b65ef7eaf4ede18e6bf47fc0bbdd79402b5b5
2016-03-15 13:57:09 -07:00
Eric St. John 7600be1e8b Make desktop inbox contracts match inbox version
Fixes https://github.com/dotnet/corefx/issues/5842

For API assemblies that are inbox in desktop and have no API changes
over the version in desktop, don't increment revision.


Commit migrated from https://github.com/dotnet/corefx/commit/6ad2e34491d3cd3a078c225f98b2c49268db81e1
2016-03-15 13:57:04 -07:00
Justin Van Patten 34d430921b HttpClient: Add comment to Set-Cookie test
Add a comment explaining the header value lengths being tested.


Commit migrated from https://github.com/dotnet/corefx/commit/2664968783439ddc3b64b99e0d42d1d293e1a082
2016-03-12 09:07:03 -08:00
David Shulman a576f9d8e1 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/ad0aa0c7f912a39275c955062e805d8853993f31
2016-03-11 07:07:20 -08:00
David Shulman 420449a472 Fix WinHttpHandler when no proxy creds after 407 response
We were getting an assert if we had an authenticating proxy but didn't have any credentials to send. After the initial 407 was received from the proxy, we then tried to set credentials for a retry. But since we didn't have any, we triggered an assert in SetWinHttpCredential.

The fix is to check for null credentials after getting the 407 response. If there are no credentials, then we end the retry loop with the final 407 status code.


Commit migrated from https://github.com/dotnet/corefx/commit/89966ef37a1269471069c2ee14cdb6af51d8a707
2016-03-10 19:18:38 -08:00
Christopher Costa aab016344e Fat package conversions
Commit migrated from https://github.com/dotnet/corefx/commit/be08afd9701053f5f9369762db58b87c8ca9559f
2016-03-10 16:15:19 -08:00
Stephen Toub 4374bc6d33 Merge pull request dotnet/corefx#6799 from stephentoub/strip_content_headers
Remove content headers in CurlHandler when automatically decompressed

Commit migrated from https://github.com/dotnet/corefx/commit/1ca11068f411628cce053d9ef0295b80e7135d90
2016-03-10 14:54:54 -05:00
Stephen Toub 7be7352c24 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/c6035bb1dbf5abc61c89fd93008416c3b900b1ff
2016-03-10 13:47:24 -05:00
stephentoub d5e591e45a Update packages to rc3-23910
Commit migrated from https://github.com/dotnet/corefx/commit/ab3948bfab039aac2afc1b521883425a171b982d
2016-03-10 09:37:40 -05:00
stephentoub edeb083709 Remove content headers in CurlHandler when encoded
WinHttpHandler removes the Content-Length and Content-Encoding headers when the content was automatically decompressed.  Do the same in CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/093dafe74d53c2222ff6f434107d49205cf7fa2f
2016-03-10 08:14:59 -05:00
Justin Van Patten 0d18ce8a1d HttpClient should not miss Set-Cookie response headers
Recent changes due to PR dotnet/corefx#3199 caused `HttpClient` on Windows to miss
`Set-Cookie` response headers when one of the header values was large
enough to cause `WinHttpQueryHeaders` to fail with
`ERROR_INSUFFICIENT_BUFFER` and advance the index.

This commit addresses the regression, by always setting the index
back to the index we want to retrieve.

Added a new test to validate this change.

Fixes dotnet/corefx#6737.


Commit migrated from https://github.com/dotnet/corefx/commit/f7e9f00aba800d2ea63e040deafcc7ee220331fc
2016-03-09 02:35:42 -08:00
Eric St. John 8cba463a08 Update crypto package dependency versions
System.Security.Cryptography.Algorithms, Cng, and X509Certificates are
now 4.1.0.  Update dependencies to ensure we get the right build.


Commit migrated from https://github.com/dotnet/corefx/commit/6e3e29dbec3705094a539b6b2dc863c5a8ee270c
2016-03-08 21:40:47 -08:00
Eric St. John 04a73fbed6 Update packages to rc3-23908
Commit migrated from https://github.com/dotnet/corefx/commit/86a230845c4f1840dcb9b52165c6976fad5b5868
2016-03-08 08:46:50 -08:00
Stephen Toub ab2ef9d0fd Merge pull request dotnet/corefx#6727 from davidsh/blank_statusdescription
HttpResponseMessage.ReasonPhrase should not be null

Commit migrated from https://github.com/dotnet/corefx/commit/3da7a023a2cf89c0a980a6c5cde25b67be530f68
2016-03-07 20:40:09 -05:00
David Shulman 1e120fdd63 HttpResponseMessage.ReasonPhrase should not be null
Recent changes due to PR dotnet/corefx#3199 caused the `HttpResponseMessage.ReasonPhrase` property to be a null string if the HTTP server response only contained a statuscode but no description on the status line. The existing .NET Framwork behavior is to have empty string as the property value in that case.

Added a new test to validate this change.

Fixes dotnet/corefx#6721.


Commit migrated from https://github.com/dotnet/corefx/commit/19ec320403cd53ad0cba75c69a1a2c027ed867d5
2016-03-07 12:23:04 -08:00
stephentoub 38f7d19954 Update packages to rc3-23907
Commit migrated from https://github.com/dotnet/corefx/commit/baed539ebb753fefc91da9870ddeee72df0a6e14
2016-03-07 10:12:40 -05:00
stephentoub 4737c9c91c Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/ad33a55907ff347cb3cb052aafe0bdd63dd524c0
2016-03-04 19:08:06 -05:00
stephentoub f6386c1530 Disable SSLv2 and SSLv3 in CurlHandler
Commit migrated from https://github.com/dotnet/corefx/commit/2ec7d66814f0f2a789356590962d5198c9745912
2016-03-04 17:02:27 -05:00
stephentoub f3434408bc Update xunit.netcore.extensions to 00187
Commit migrated from https://github.com/dotnet/corefx/commit/3cfd81e7369628d052da6367b28c6f5b5839f55d
2016-03-03 22:06:40 -05:00
stephentoub 579dd2cba9 Address more PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/15b2483a8d1ce5d495f75588ec2f1c0e3ae5bb2b
2016-03-03 12:21:10 -05:00
stephentoub b4708c3018 Add additional tests for IsBypassed and DefaultCredentials
And fixed a few other nits of feedback.


Commit migrated from https://github.com/dotnet/corefx/commit/bbef5f03fdbdf276851d82ce2c189b4ea1a4a826
2016-03-03 11:31:33 -05:00