Skip to content
Draft
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 @@ -182,8 +182,6 @@ private static SslProtocols FilterOutIncompatibleSslProtocols(SslProtocols proto
{
#pragma warning disable 0618
// SSL2 is mutually exclusive with >= TLS1.2
// On Windows10 SSL2 flag has no effect but on earlier versions of the OS
// opting into both SSL2 and >= TLS1.2 causes negotiation to always fail.
protocols &= ~SslProtocols.Ssl2;
#pragma warning restore 0618
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.Versioning;
using System.Security.Cryptography.X509Certificates;

namespace System.Net.Security
Expand All @@ -22,10 +21,8 @@ public static SslCertificateTrust CreateForX509Store(X509Store store, bool sendT
}
#endif
if (sendTrustInHandshake && !System.OperatingSystem.IsLinux() && !System.OperatingSystem.IsMacOS() &&
// Necessary functions are available only on win 8 onwards
!OperatingSystem.IsWindowsVersionAtLeast(6, 2))
!System.OperatingSystem.IsWindows())
{
// to be removed when implemented.
throw new PlatformNotSupportedException(SR.net_ssl_trust_handshake);
}
if (!store.IsOpen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private static unsafe void AttachCertificateStore(SafeFreeCredentials cred, X509
return;
}

// This is legacy crypto API used on .NET Framework and older Windows versions.
// This is legacy crypto API used on older Windows 10 versions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This is legacy crypto API used on older Windows 10 versions.
// This is legacy crypto API used on older Windows versions.

// It only supports TLS up to 1.2
public static unsafe SafeFreeCredentials AcquireCredentialsHandleSchannelCred(SslAuthenticationOptions authOptions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static bool OSSupportsExtendedProtection
{
get
{
// .NET Core is supported only on Win7+ where ExtendedProtection is supported.
// .NET is supported only on Windows where ExtendedProtection is supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// .NET is supported only on Windows where ExtendedProtection is supported.
// ExtendedProtection is supported on all Windows versions supported by current .NET version.

return OperatingSystem.IsWindows();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public async Task SslStream_SameCertUsedForClientAndServer_Ok()
if (Capability.IsTrustedRootCertificateInstalled())
{
// https://technet.microsoft.com/en-us/library/hh831771.aspx#BKMK_Changes2012R2
// Starting with Windows 8, the "Management of trusted issuers for client authentication" has changed:
// The behavior to send the Trusted Issuers List by default is off.
// On Windows, the "Management of trusted issuers for client authentication" is configured
// such that the behavior to send the Trusted Issuers List by default is off.

Assert.True(client.IsMutuallyAuthenticated);
Assert.True(server.IsMutuallyAuthenticated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async Task ClientAndServer_OneOrBothUseDefault_Ok(SslProtocols? clientPro
await TestConfiguration.WhenAllOrAnyFailedWithTimeout(
AuthenticateClientAsync(serverHost, clientCertificates, checkCertificateRevocation: false, protocols: clientProtocols),
AuthenticateServerAsync(serverCertificate, clientCertificateRequired: true, checkCertificateRevocation: false, protocols: serverProtocols));
if (PlatformDetection.IsWindows && PlatformDetection.WindowsVersion >= 10 &&
if (PlatformDetection.IsWindows &&
#pragma warning disable 0618
clientProtocols.GetValueOrDefault() != SslProtocols.Default &&
serverProtocols.GetValueOrDefault() != SslProtocols.Default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@ public static Task WhenAllOrAnyFailedWithTimeout(params Task[] tasks)
// On Windows, null ciphers (no encryption) are supported.
if (OperatingSystem.IsWindows())
{
if (!PlatformDetection.IsWindows10OrLater)
{
// All old versions support null encryption
return true;
}

try
{
// New Windows can support null but it may be disabled in Azure images
// Null encryption may be disabled in Azure images
using (Process p = Process.Start(new ProcessStartInfo("powershell", "-Command Get-TlsCipherSuite") { RedirectStandardOutput = true, RedirectStandardError = true }))
{
using StreamReader reader = p.StandardOutput;
Expand Down
Loading