File tree Expand file tree Collapse file tree 3 files changed +2
-35
lines changed
System.Net.Http.WinHttpHandler/src/System/Net/Http Expand file tree Collapse file tree 3 files changed +2
-35
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,7 @@ public class WinHttpHandler : HttpMessageHandler
43
43
internal static readonly Version HttpVersion20 = new Version ( 2 , 0 ) ;
44
44
internal static readonly Version HttpVersion30 = new Version ( 3 , 0 ) ;
45
45
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 ;
50
47
51
48
internal static bool CertificateCachingAppContextSwitchEnabled { get ; } = AppContext . TryGetSwitch ( "System.Net.Http.UseWinHttpCertificateCaching" , out bool enabled ) && enabled ;
52
49
private static readonly TimeSpan s_maxTimeout = TimeSpan . FromMilliseconds ( int . MaxValue ) ;
Original file line number Diff line number Diff line change @@ -13,11 +13,7 @@ internal sealed class SslAuthenticationOptions : IDisposable
13
13
{
14
14
private const string EnableOcspStaplingContextSwitchName = "System.Net.Security.EnableServerOcspStaplingFromOnlyCertificateOnLinux" ;
15
15
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 ;
21
17
22
18
internal SslAuthenticationOptions ( )
23
19
{
Original file line number Diff line number Diff line change @@ -83,31 +83,5 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout(
83
83
Assert . True ( File . ReadAllText ( tempFile ) . Length == 0 ) ;
84
84
}
85
85
}
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
- }
112
86
}
113
87
}
You can’t perform that action at this time.
0 commit comments