Skip to content

Commit d207f7d

Browse files
committed
2nd try
1 parent b68154b commit d207f7d

File tree

3 files changed

+2
-35
lines changed

3 files changed

+2
-35
lines changed

src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ public class WinHttpHandler : HttpMessageHandler
4343
internal static readonly Version HttpVersion20 = new Version(2, 0);
4444
internal static readonly Version HttpVersion30 = new Version(3, 0);
4545
internal static readonly Version HttpVersionUnknown = new Version(0, 0);
46-
internal static bool DefaultCertificateRevocationCheck { get; } =
47-
AppContextSwitchHelper.GetBooleanConfig(
48-
"System.Net.Security.NoRevocationCheckByDefault",
49-
"DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT") ? false : true;
46+
internal static bool DefaultCertificateRevocationCheck { get; } = false;
5047

5148
internal static bool CertificateCachingAppContextSwitchEnabled { get; } = AppContext.TryGetSwitch("System.Net.Http.UseWinHttpCertificateCaching", out bool enabled) && enabled;
5249
private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue);

src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ internal sealed class SslAuthenticationOptions : IDisposable
1313
{
1414
private const string EnableOcspStaplingContextSwitchName = "System.Net.Security.EnableServerOcspStaplingFromOnlyCertificateOnLinux";
1515

16-
internal static readonly X509RevocationMode DefaultRevocationMode =
17-
AppContextSwitchHelper.GetBooleanConfig(
18-
"System.Net.Security.NoRevocationCheckByDefault",
19-
"DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT")
20-
? X509RevocationMode.NoCheck : X509RevocationMode.Online;
16+
internal const X509RevocationMode DefaultRevocationMode = X509RevocationMode.NoCheck;
2117

2218
internal SslAuthenticationOptions()
2319
{

src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,5 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout(
8383
Assert.True(File.ReadAllText(tempFile).Length == 0);
8484
}
8585
}
86-
87-
[ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
88-
[InlineData(true)]
89-
[InlineData(false)]
90-
public void DefaultRevocationMode_OfflineRevocationByDefault_True_UsesNoCheck(bool useEnvVar)
91-
{
92-
var psi = new ProcessStartInfo();
93-
if (useEnvVar)
94-
{
95-
psi.Environment.Add("DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT", "true");
96-
}
97-
98-
Assert.Equal(X509RevocationMode.Online, new SslClientAuthenticationOptions().CertificateRevocationCheckMode);
99-
Assert.Equal(X509RevocationMode.Online, new SslServerAuthenticationOptions().CertificateRevocationCheckMode);
100-
101-
RemoteExecutor.Invoke(useEnvVar =>
102-
{
103-
if (!bool.Parse(useEnvVar))
104-
{
105-
AppContext.SetSwitch("System.Net.Security.NoRevocationCheckByDefault", true);
106-
}
107-
108-
Assert.Equal(X509RevocationMode.NoCheck, new SslClientAuthenticationOptions().CertificateRevocationCheckMode);
109-
Assert.Equal(X509RevocationMode.NoCheck, new SslServerAuthenticationOptions().CertificateRevocationCheckMode);
110-
}, useEnvVar.ToString(), new RemoteInvokeOptions { StartInfo = psi }).Dispose();
111-
}
11286
}
11387
}

0 commit comments

Comments
 (0)