@@ -23,8 +23,6 @@ public class ServerAsyncAuthenticateTest : IDisposable
23
23
private readonly ITestOutputHelper _logVerbose ;
24
24
private readonly X509Certificate2 _serverCertificate ;
25
25
26
- public static bool IsNotWindows7 => ! PlatformDetection . IsWindows7 ;
27
-
28
26
public ServerAsyncAuthenticateTest ( ITestOutputHelper output )
29
27
{
30
28
_log = output ;
@@ -99,9 +97,8 @@ public async Task ServerAsyncAuthenticate_SimpleSniOptions_Success()
99
97
}
100
98
}
101
99
102
- [ ConditionalTheory ( nameof ( IsNotWindows7 ) ) ]
103
- [ InlineData ( SslProtocols . Tls11 ) ]
104
- [ InlineData ( SslProtocols . Tls12 ) ]
100
+ [ Theory ]
101
+ [ MemberData ( nameof ( SupportedProtocolData ) ) ]
105
102
public async Task ServerAsyncAuthenticate_SniSetVersion_Success ( SslProtocols version )
106
103
{
107
104
var serverOptions = new SslServerAuthenticationOptions ( ) { ServerCertificate = _serverCertificate , EnabledSslProtocols = version } ;
@@ -247,6 +244,18 @@ public static IEnumerable<object[]> ProtocolMismatchData()
247
244
yield return new object [ ] { SslProtocols . Tls12 , SslProtocols . Tls11 , typeof ( AuthenticationException ) } ;
248
245
}
249
246
247
+ public static IEnumerable < Object [ ] > SupportedProtocolData ( )
248
+ {
249
+ if ( PlatformDetection . SupportsTls11 )
250
+ {
251
+ yield return new object [ ] { SslProtocols . Tls11 } ;
252
+ }
253
+
254
+ if ( PlatformDetection . SupportsTls12 )
255
+ {
256
+ yield return new object [ ] { SslProtocols . Tls12 } ;
257
+ }
258
+ }
250
259
#region Helpers
251
260
252
261
private async Task ServerAsyncSslHelper (
0 commit comments