diff --git a/src/libraries/System.Net.Security/src/ExcludeApiList.PNSE.Browser.txt b/src/libraries/System.Net.Security/src/ExcludeApiList.PNSE.Browser.txt new file mode 100644 index 00000000000000..dc62c8e2c7ab25 --- /dev/null +++ b/src/libraries/System.Net.Security/src/ExcludeApiList.PNSE.Browser.txt @@ -0,0 +1 @@ +P:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy.OSSupportsExtendedProtection diff --git a/src/libraries/System.Net.Security/src/System.Net.Security.csproj b/src/libraries/System.Net.Security/src/System.Net.Security.csproj index 5579515616d2bd..de2bab312e74e2 100644 --- a/src/libraries/System.Net.Security/src/System.Net.Security.csproj +++ b/src/libraries/System.Net.Security/src/System.Net.Security.csproj @@ -15,7 +15,7 @@ true true $(DefineConstants);SYSNETSECURITY_NO_OPENSSL - ReferenceAssemblyExclusions.txt + $(MSBuildThisFileDirectory)ExcludeApiList.PNSE.Browser.txt @@ -430,6 +430,9 @@ + + + diff --git a/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.APIOverride.cs b/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.APIOverride.cs new file mode 100644 index 00000000000000..3af698f1bd8918 --- /dev/null +++ b/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.APIOverride.cs @@ -0,0 +1,20 @@ +// 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.InteropServices; + +namespace System.Security.Authentication.ExtendedProtection +{ + public partial class ExtendedProtectionPolicy + { + public static bool OSSupportsExtendedProtection + { + get + { + // .NET Core is supported only on Win7+ where ExtendedProtection is supported. + // and unsupported on the browser + return !OperatingSystem.IsBrowser(); + } + } + } +} diff --git a/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.cs b/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.cs index d0d19339322f76..b2fc7aa4823c66 100644 --- a/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.cs +++ b/src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.cs @@ -143,14 +143,5 @@ public override string ToString() return sb.ToString(); } - - public static bool OSSupportsExtendedProtection - { - get - { - // .NET Core is supported only on Win7+ where ExtendedProtection is supported. - return true; - } - } } }