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
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
- 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
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
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
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
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
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
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.
Fixesdotnet/corefx#6737.
Commit migrated from https://github.com/dotnet/corefx/commit/f7e9f00aba800d2ea63e040deafcc7ee220331fc
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.
Fixesdotnet/corefx#6721.
Commit migrated from https://github.com/dotnet/corefx/commit/19ec320403cd53ad0cba75c69a1a2c027ed867d5
We don't currently have any functional tests in the repo for using HTTP proxies. This commit adds a very simple loopback GET request proxy server, just enough to verify that HttpClient does go through the specified proxy and pass credentials if requested. If/when we get better infrastructure in place for this kind of thing, we can remove the proxy implementation and replace the test, but for now, this at least provides some automated verification cross-platform.
Commit migrated from https://github.com/dotnet/corefx/commit/db2d84b0bb4032ca21b8e7c9cfd96056ffddbab2
Correct instances of new "ArgumentException(nameof(..." so names are in the correct parameter. Where possible, I chose the resource string I felt best fit the situation. Otherwise, I created a new entry (I'm assuming there's some extra work that needs to be done there, but don't know what it is offhand).
Commit migrated from https://github.com/dotnet/corefx/commit/368fdfd86ee3a3bf1bca2a6c339ee590f3d6505d