Files
dotnet-runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.Unix.cs
T
Stephen Toub 7be9b5bb5f Switch tests to use thread-local switch for ManagedHandler
And as a result re-enable parallelism of the test suite, which on my machine reduces the running time of the outerloop tests from 150s to 45s.


Commit migrated from https://github.com/dotnet/corefx/commit/3db504ec31fb03162b33e0658870aef5af4e4abe
2017-09-21 08:26:44 -04:00

34 lines
1.3 KiB
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.IO;
using System.Net.Security;
using System.Net.Sockets;
using System.Net.Test.Common;
using System.Runtime.InteropServices;
using System.Security.Authentication;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
namespace System.Net.Http.Functional.Tests
{
public partial class HttpClientHandler_SslProtocols_Test
{
private bool BackendSupportsSslConfiguration =>
UseManagedHandler ||
(CurlSslVersionDescription()?.StartsWith("OpenSSL") ?? false);
private bool SSLv3DisabledByDefault =>
BackendSupportsSslConfiguration ||
Version.Parse(CurlVersionDescription()) >= new Version(7, 39); // libcurl disables SSLv3 by default starting in v7.39
[DllImport("System.Net.Http.Native", EntryPoint = "HttpNative_GetVersionDescription")]
private static extern string CurlVersionDescription();
[DllImport("System.Net.Http.Native", EntryPoint = "HttpNative_GetSslVersionDescription")]
private static extern string CurlSslVersionDescription();
}
}