Skip to content

improve SslStream tests on server 2022 #64968

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

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -56,7 +56,12 @@ public static partial class PlatformDetection
// >= Windows 10 20H1 Update
public static bool IsWindows10Version2004OrGreater => IsWindowsVersionOrLater(10, 0, 19041);

public static bool IsWindows10Version2004Build19573OrGreater => IsWindowsVersionOrLater(10, 0, 19573);
// WinHTTP update
public static bool IsWindows10Version19573OrGreater => IsWindowsVersionOrLater(10, 0, 19573);

// Windows Server 2022
public static bool IsWindows10Version20348OrGreater => IsWindowsVersionOrLater(10, 0, 20348);


// Windows 11 aka 21H2
public static bool IsWindows10Version22000OrGreater => IsWindowsVersionOrLater(10, 0, 22000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private static bool GetTls13Support()
// assume no if positive entry is missing on older Windows
// Latest insider builds have TLS 1.3 enabled by default.
// The build number is approximation.
bool defaultProtocolSupport = IsWindows10Version2004Build19573OrGreater;
bool defaultProtocolSupport = IsWindows10Version20348OrGreater;

#if NETFRAMEWORK
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ await LoopbackServer.CreateClientAndServerAsync(

// Disabling it for full .Net Framework due to a missing ALPN API which leads to a protocol downgrade
#if !NETFRAMEWORK
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows10Version2004Build19573OrGreater))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows10Version19573OrGreater))]
public async Task UseClientCertOnHttp2_OSSupportsIt_Success()
{
using X509Certificate2 clientCert = Test.Common.Configuration.Certificates.GetClientCertificate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,17 +472,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout(
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.SupportsTls13))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58927", TestPlatforms.Windows)]
[InlineData(true)]
[InlineData(false)]
[PlatformSpecific(TestPlatforms.Windows)]
public async Task SslStream_NegotiateClientCertificateAsyncTls13_Succeeds(bool sendClientCertificate)
{
if (PlatformDetection.IsWindows10Version22000OrGreater)
{
// [ActiveIssue("https://github.com/dotnet/runtime/issues/58927")]
throw new SkipTestException("Unstable on Windows 11");
}

bool negotiateClientCertificateCalled = false;
using CancellationTokenSource cts = new CancellationTokenSource();
cts.CancelAfter(TestConfiguration.PassingTestTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static IEnumerable<object[]> SslStream_StreamToStream_Authentication_Succ
public async Task SslStream_StreamToStream_Authentication_Success(X509Certificate serverCert = null, X509Certificate clientCert = null)
{

if (PlatformDetection.IsWindows10Version22000OrGreater)
if (PlatformDetection.IsWindows10Version20348OrGreater)
{
// [ActiveIssue("https://github.com/dotnet/runtime/issues/58927")]
throw new SkipTestException("Unstable on Windows 11");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static IEnumerable<object[]> OneOrBothUseDefaulData()
[MemberData(nameof(OneOrBothUseDefaulData))]
public async Task ClientAndServer_OneOrBothUseDefault_Ok(SslProtocols? clientProtocols, SslProtocols? serverProtocols)
{
if (PlatformDetection.IsWindows10Version22000OrGreater)
if (PlatformDetection.IsWindows10Version20348OrGreater)
{
// [ActiveIssue("https://github.com/dotnet/runtime/issues/58927")]
throw new SkipTestException("Unstable on Windows 11");
Expand Down