Fixes https://github.com/dotnet/corefx/issues/5707
We are changing the .NET packages to no longer use the ‘dotnet’, ‘dotnet5.x’, and ‘dnxcore50’ monikers. This is thee first stage of the change for dotnet->netstandard.
The replacements are as follows
Old moniker | New moniker
----------------- | ------------------
dotnet5.x | netstandard1.y (where y = x -1)
DNXCore50 | netstandardapp1.5
dotnet | netstandard1.3
To prepare for this change you can do the following to your project.json. This change will require a recent build of NuGet or dotnet.exe and can be done prior to consuming the packages with the breaking change. These packages will not work with DNX.
For a project targeting dotnet5.6
```
"frameworks": {
"netstandard1.5": {
"imports": [ "dotnet5.6" ]
}
},
```
For a project targeting dnxcore50
```
"frameworks": {
"netstandardapp1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
},
```
[tfs-changeset: 1578321]
Commit migrated from https://github.com/dotnet/corefx/commit/4435f9f2776ae007e05f4454675e56cf76a51975
* Move all of the project configurations currently living in the
"facade\<lib>.csproj" files into the root library project. This means
there will now be only one project file for the source build of each
library, regardless of how many configurations it has. The .builds file
of each library will only reference that single project file multiple
times.
* Do some minor cleanup of project files along the way. Fix up the VS
default configuration blocks to be a bit more uniform. Remove redundant
defaults (OutputType, PlatformTarget, etc. Fix some condition spacing.
Commit migrated from https://github.com/dotnet/corefx/commit/26edfd6839044ca6368e28502e0893c1b1819b4c
Explicit static cctors cause the C# compiler to not mark types as beforefieldinit, which in turn means that the backend compiler needs to add checks to static methods to ensure that the type has been initialized. We have a bunch of such cctors across corefx that can be easily removed; this commit does so. In a few places, it also presizes some collections to help avoid unnecessary memory pressure.
Commit migrated from https://github.com/dotnet/corefx/commit/79ae21b1b9a113230da7ebfbffa4e3c3fe36f0ac
Some fixes (adding imports, adding Platforms package) were tooled, but more complex ones (forking project.jsons, editing csproj's) were not.
Also makes dependency version validation rules case-insensitive. (I used this fix to update the versions of some packages.)
[tfs-changeset: 1573868]
Commit migrated from https://github.com/dotnet/corefx/commit/84af04317505d48feaa1e83dd5dc27ddc0f6de76
The property leaks through the abstraction. It's rarely used. And it complicates things on Unix due to exposing the underlying socket instance combined with difficulties with multiple connect calls on a single socket instance.
Until we have good reason to expose it in the contract, we're removing it from the contract before it's stable.
Commit migrated from https://github.com/dotnet/corefx/commit/30abd30421289509cd3bd18a9114501afdc0fb7c
In an application that's using the Redis client library, a significant portion of the allocations are coming from calls to ReadByte on an SslStream. Since SslStream doesn't override ReadByte, the base Stream.ReadByte is used, and it ends up allocating a temporary array to use in a call to Read.
This commit adds an override of ReadByte on SslStream that returns data from the stream's internal buffer if any is available, otherwise falling back to the old behavior.
On a test that repeatedly writes 1000 bytes and then reads each of those with ReadByte, allocations are reduced by 10x and throughput is doubled. (Note that removing the Interlocked.Exchange in ReadByte yields another 20% improvement in throughput, but I've left it in so as not to impact guarantees of the type.)
Commit migrated from https://github.com/dotnet/corefx/commit/b999431c9c519a797aff3eb472b614e0f15c6650
Pass the handle:
The Windows SslStream flow is to start a TLS session as server auth, then
process a CredentialsRequired during the handshake, add credentials to
the existing session, and continue.
It's hard to maintain symmetry on that flow for the Unix pathway, due to
the API differences in OpenSSL and SChannel. So, the Unix session will
always pass down to native the provided client auth credentials, and
OpenSSL can use them when it sees appropriate.
Untrusted certificates should still complete handshake:
The Unix SslStream implementation had two different places that a client
authentication certificate was validated. The first one was from an
OpenSSL callback, and reporting an error will interrupt the TLS handshake.
The second was from after the handshake, and presents the results to the
user validation callback to determine if data should be sent after the handshake.
In the ideal case the first version is redundant, in a user-handled case it caused
a failure when success was expected; so it should just be removed.
Enable the client authentication cert test for Unix:
Also asserts that the IsMutuallyAuthenticated property gets set, the certificates
used were the correct ones, and that both forward and callback versions of
providing the certificate function.
Commit migrated from https://github.com/dotnet/corefx/commit/908a129d5f32a6b5d2737d651445fdd38e1937ea
The design of AuthenticateAsServerAsync has a clientCertificatesRequired flag. On Unix we were mapping that to "SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT", which causes OpenSSL to fail the handshake if no cert is provided. But the Windows code actually still allows this through, instead setting a policy error to indicate that no certificate was required. I'm simply removing the SSL_VERIFY_FAIL_IF_NO_PEER_CERT flag to match that design. I've also updated the test to assert that the error is actually being set.
Commit migrated from https://github.com/dotnet/corefx/commit/81f6c96f4f0562f1dfdf348f5ea9c126be28251e