[release/6.0] update expected exception for cases when all requested TLS versions...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fri, 11 Mar 2022 20:51:44 +0000 (12:51 -0800)
committerGitHub <noreply@github.com>
Fri, 11 Mar 2022 20:51:44 +0000 (12:51 -0800)
* update expected exception for cases when all requested TLS versions are disabled

* port test fix

Co-authored-by: wfurt <tweinfurt@yahoo.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs

index 5a643c0..d6ecb3b 100644 (file)
@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.IO;
 using System.Net.Security;
 using System.Net.Test.Common;
@@ -294,9 +295,10 @@ namespace System.Net.Http.Functional.Tests
                     {
                         await serverTask;
                     }
-                    catch (Exception e) when (e is IOException || e is AuthenticationException)
+                    catch (Exception e) when (e is IOException || e is AuthenticationException || e is Win32Exception)
                     {
                         // Some SSL implementations simply close or reset connection after protocol mismatch.
+                        // The call may fail if neither of the requested protocols is available
                         // Newer OpenSSL sends Fatal Alert message before closing.
                         return;
                     }