Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SupportsTls11 and SupportsTls12 to PlatformDetection avoid OS versions in tests #39482

Merged
merged 3 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ public static bool IsNonZeroLowerBoundArraySupported

public static bool SupportsClientAlpn => SupportsAlpn || IsOSX || IsiOS || IstvOS;

// TLS 1.1 and 1.2 can work on Windows7 but it is not enabled by default.
public static bool SupportsTls11 => !IsWindows7 && !IsDebian10;
public static bool SupportsTls12 => !IsWindows7;
// OpenSSL 1.1.1 and above.
public static bool SupportsTls13 => GetTls13Support();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ServerAsyncAuthenticateTest : IDisposable
private readonly ITestOutputHelper _logVerbose;
private readonly X509Certificate2 _serverCertificate;

public static bool IsNotWindows7 => !PlatformDetection.IsWindows7;
public static bool SupportsTls11 => PlatformDetection.SupportsTls11;

public ServerAsyncAuthenticateTest(ITestOutputHelper output)
{
Expand Down Expand Up @@ -99,7 +99,7 @@ public async Task ServerAsyncAuthenticate_SimpleSniOptions_Success()
}
}

[ConditionalTheory(nameof(IsNotWindows7))]
[ConditionalTheory(nameof(SupportsTls11))]
[InlineData(SslProtocols.Tls11)]
[InlineData(SslProtocols.Tls12)]
public async Task ServerAsyncAuthenticate_SniSetVersion_Success(SslProtocols version)
Expand Down