fix GetAsync_SupportedSSLVersion_Succeeds test (#41056)
authorTomas Weinfurt <tweinfurt@yahoo.com>
Mon, 24 Aug 2020 21:07:59 +0000 (14:07 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Aug 2020 21:07:59 +0000 (14:07 -0700)
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs

index 65342bf..17ab7a4 100644 (file)
@@ -142,9 +142,20 @@ namespace System.Net.Http.Functional.Tests
                 yield return new object[] { SslProtocols.Ssl3, Configuration.Http.SSLv3RemoteServer };
             }
 #pragma warning restore 0618
-            yield return new object[] { SslProtocols.Tls, Configuration.Http.TLSv10RemoteServer };
-            yield return new object[] { SslProtocols.Tls11, Configuration.Http.TLSv11RemoteServer };
-            yield return new object[] { SslProtocols.Tls12, Configuration.Http.TLSv12RemoteServer };
+            if (PlatformDetection.SupportsTls10)
+            {
+                yield return new object[] { SslProtocols.Tls, Configuration.Http.TLSv10RemoteServer };
+            }
+
+            if (PlatformDetection.SupportsTls11)
+            {
+                yield return new object[] { SslProtocols.Tls11, Configuration.Http.TLSv11RemoteServer };
+            }
+
+            if (PlatformDetection.SupportsTls12)
+            {
+                yield return new object[] { SslProtocols.Tls12, Configuration.Http.TLSv12RemoteServer };
+            }
         }
 
         // We have tests that validate with SslStream, but that's limited by what the current OS supports.