From 9930499ee10fb5ad739c36ad313965d2254da032 Mon Sep 17 00:00:00 2001 From: "Chris Ross (ASP.NET)" Date: Mon, 2 Apr 2018 14:56:41 -0700 Subject: [PATCH] Work around HttpClient TLS regression --- .../Autobahn/AutobahnTester.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs b/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs index bc629e759b..1b253e1627 100644 --- a/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs +++ b/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; +using System.Security.Authentication; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -160,6 +161,8 @@ namespace Microsoft.AspNetCore.WebSockets.ConformanceTest.Autobahn cancellationToken.ThrowIfCancellationRequested(); var handler = new HttpClientHandler(); + // Win7 HttpClient on NetCoreApp2.1 defaults to TLS 1.0 and won't connect to Kestrel. https://github.com/dotnet/corefx/issues/28733 + handler.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11; if (ssl) { // Don't take this out of the "if(ssl)". If we set it on some platforms, it crashes