Files
Martin Baulig 7277e3bb5e SslStream improvements and tests
* Add server-side Server-Name-Indication (SNI) support (both AppleTls and BTLS).

* Support the new `SslServerAuthenticationOptions.ServerCertificateSelectionCallback`.

* Server certificate selection is now compatible with CoreFx behavior; first
  checking the new `ServerCertSelectionDelegate` then `LocalCertSelectionCallback`
  and finally using an explicitly provided certificate.

* Misc exception checks and fixes to make behavior consistent with CoreFx;
  any exception thrown by reading / writing the underlying stream will now be
  propagated verbatim (and not wrapped in an `AuthenticationException`);
  exceptions thrown by the handshake / TLS stack itself will still be wrapped.

* Added `System.Net.Security` xUnit tests from CoreFx.

* Misc test cleanups; moved certificate test files from `System.Net.Http` into
  `System` and embed them in the test assembly as resources, adjusting
  `test-helpers/Configuration.Certificates.cs` accordingly.
2019-02-21 20:43:25 +01:00

22 lines
856 B
C#

namespace System
{
static partial class PlatformDetection
{
public static bool IsOSX => true;
public static bool IsDebian => false;
internal static bool IsSsl2AndSsl3Supported => false;
/*
* Use of these properties should be strictly limited to the `System.Net.Http` tests.
*
* Please do not move them into the shared PlatformDetection part or use them outside
* this directory without previously talking to me (Martin Baulig ([email protected]))
* as I plan to eventually remove / replace them with a more robust mechanism.
*/
public static Version OpenSslVersion => new Version (-1, 0);
public static bool SupportsX509Chain => UsingBtls;
public static bool SupportsCertRevocation => !UsingBtls;
public static bool UsingBtls => string.Equals (Environment.GetEnvironmentVariable ("MONO_TLS_PROVIDER"), "btls");
}
}