diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 57b579fa4892..6737fb09e881 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,284 +9,284 @@ --> - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/efcore - f7be8b345cec25ef501e0824e6fb5a0c9ee25a9e + a5bc598977d41095fa37895e85ea626217fa9eb4 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 6e26872d0a282aa71ea792c3550a3cb0e8bf4e71 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index c06d465a778e..0519cb8a85d1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -63,76 +63,76 @@ --> - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 + 7.0.0-preview.3.22161.10 - 7.0.0-preview.3.22127.1 + 7.0.0-preview.3.22161.10 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 + 7.0.0-preview.3.22159.9 7.0.0-beta.22124.4 7.0.0-beta.22124.4 @@ -197,9 +197,9 @@ --> 3.3.1 3.3.1 - 4.0.0-4.final - 4.0.0-4.final - 4.0.0-4.final + 4.2.0-2.22128.1 + 4.2.0-2.22128.1 + 4.2.0-2.22128.1 3.3.0 1.1.1-beta1.21413.1 1.1.1-beta1.21413.1 diff --git a/global.json b/global.json index f5f2a774ef3b..a7233e2b6b38 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "7.0.100-preview.2.22114.1" + "version": "7.0.100-preview.3.22159.27" }, "tools": { - "dotnet": "7.0.100-preview.2.22114.1", + "dotnet": "7.0.100-preview.3.22159.27", "runtimes": { "dotnet": [ "2.1.30", diff --git a/src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteHandlers/DetectMisplacedLambdaAttribute.cs b/src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteHandlers/DetectMisplacedLambdaAttribute.cs index 96ecd8297224..6363fc929215 100644 --- a/src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteHandlers/DetectMisplacedLambdaAttribute.cs +++ b/src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteHandlers/DetectMisplacedLambdaAttribute.cs @@ -27,12 +27,12 @@ private static void DetectMisplacedLambdaAttribute( // () => Hello() has a single child which is a BlockOperation so we check to see if // expression associated with that operation is an invocation expression - if (lambda.Children.FirstOrDefault().Syntax is InvocationExpressionSyntax innerInvocation) + if (lambda.ChildOperations.FirstOrDefault().Syntax is InvocationExpressionSyntax innerInvocation) { targetInvocation = innerInvocation; } - if (lambda.Children.FirstOrDefault().Children.FirstOrDefault() is IReturnOperation returnOperation + if (lambda.ChildOperations.FirstOrDefault().ChildOperations.FirstOrDefault() is IReturnOperation returnOperation && returnOperation.ReturnedValue is IInvocationOperation returnedInvocation) { targetInvocation = (InvocationExpressionSyntax)returnedInvocation.Syntax; diff --git a/src/Middleware/StaticFiles/test/UnitTests/DefaultFilesMiddlewareTests.cs b/src/Middleware/StaticFiles/test/UnitTests/DefaultFilesMiddlewareTests.cs index 5f65db02a312..1e563b83cca3 100644 --- a/src/Middleware/StaticFiles/test/UnitTests/DefaultFilesMiddlewareTests.cs +++ b/src/Middleware/StaticFiles/test/UnitTests/DefaultFilesMiddlewareTests.cs @@ -133,6 +133,7 @@ public async Task Endpoint_PassesThrough() [InlineData("", @"./SubFolder", "", false)] [InlineData("", @"./SubFolder", "/你好", false)] [InlineData("", @"./SubFolder", "/你好/世界", false)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/40642")] public async Task FoundDirectoryWithDefaultFile_PathModified_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) { await FoundDirectoryWithDefaultFile_PathModified(baseUrl, baseDir, requestUrl, appendTrailingSlash); @@ -153,6 +154,7 @@ public async Task FoundDirectoryWithDefaultFile_PathModified_All(string baseUrl, [InlineData("", @".\subFolder", "", false)] [InlineData("", @".\SubFolder", "/你好", false)] [InlineData("", @".\SubFolder", "/你好/世界", false)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/40642")] public async Task FoundDirectoryWithDefaultFile_PathModified_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) { await FoundDirectoryWithDefaultFile_PathModified(baseUrl, baseDir, requestUrl, appendTrailingSlash); @@ -188,6 +190,7 @@ private async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, st [InlineData("", @"./", "/SubFolder", "?a=b")] [InlineData("", @"./SubFolder", "/你好", "?a=b")] [InlineData("", @"./SubFolder", "/你好/世界", "?a=b")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/40642")] public async Task NearMatch_RedirectAddSlash_All(string baseUrl, string baseDir, string requestUrl, string queryString) { await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); @@ -200,6 +203,7 @@ public async Task NearMatch_RedirectAddSlash_All(string baseUrl, string baseDir, [InlineData("", @".\", "/SubFolder", "?a=b")] [InlineData("", @".\SubFolder", "/你好", "?a=b")] [InlineData("", @".\SubFolder", "/你好/世界", "?a=b")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/40642")] public async Task NearMatch_RedirectAddSlash_Windows(string baseUrl, string baseDir, string requestUrl, string queryString) { await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); diff --git a/src/Middleware/WebSockets/test/ConformanceTests/Autobahn/AutobahnTester.cs b/src/Middleware/WebSockets/test/ConformanceTests/Autobahn/AutobahnTester.cs index 6190ad395b94..9a981c282499 100644 --- a/src/Middleware/WebSockets/test/ConformanceTests/Autobahn/AutobahnTester.cs +++ b/src/Middleware/WebSockets/test/ConformanceTests/Autobahn/AutobahnTester.cs @@ -151,7 +151,9 @@ public async Task DeployTestAndAddToSpec(ServerType server, bool ssl, string env // Win7 HttpClient on NetCoreApp2.2 defaults to TLS 1.0 and won't connect to Kestrel. https://github.com/dotnet/corefx/issues/28733 // Mac HttpClient on NetCoreApp2.0 doesn't alow you to set some combinations. // https://github.com/dotnet/corefx/blob/586cffcdfdf23ad6c193a4bf37fce88a1bf69508/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.SslProvider.OSX.cs#L104-L106 +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete handler.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; +#pragma warning restore SYSLIB0039 handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; var client = result.CreateHttpClient(handler); diff --git a/src/Servers/HttpSys/src/RequestProcessing/Request.cs b/src/Servers/HttpSys/src/RequestProcessing/Request.cs index 334b15b8f51f..8fa5579b6b49 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/Request.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/Request.cs @@ -298,7 +298,8 @@ private void GetTlsHandshakeResults() { Protocol |= SslProtocols.Ssl3; } -#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning restore CS0618 // Type or Prmember is obsolete +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete if ((Protocol & SslProtocols.Tls) != 0) { Protocol |= SslProtocols.Tls; @@ -307,6 +308,7 @@ private void GetTlsHandshakeResults() { Protocol |= SslProtocols.Tls11; } +#pragma warning restore SYSLIB0039 if ((Protocol & SslProtocols.Tls12) != 0) { Protocol |= SslProtocols.Tls12; diff --git a/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs b/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs index 99b228079511..674afb08df47 100644 --- a/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs +++ b/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs @@ -532,7 +532,9 @@ public void PrefersSslProtocolsDefinedInSniConfig() "www.example.org", new SniConfig { +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete SslProtocols = SslProtocols.Tls13 | SslProtocols.Tls11, +#pragma warning restore SYSLIB0039 Certificate = new CertificateConfig() } } @@ -550,7 +552,9 @@ public void PrefersSslProtocolsDefinedInSniConfig() logger: Mock.Of>()); var (options, _) = sniOptionsSelector.GetOptions(new MockConnectionContext(), "www.example.org"); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls13 | SslProtocols.Tls11, options.EnabledSslProtocols); +#pragma warning restore SYSLIB0039 } [Fact] @@ -690,9 +694,13 @@ public void CloneSslOptionsClonesAllProperties() // Defaults to false ClientCertificateRequired = true, // Defaults to SslProtocols.None +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete EnabledSslProtocols = SslProtocols.Tls13 | SslProtocols.Tls11, +#pragma warning restore SYSLIB0039 +#pragma warning disable SYSLIB0040 // EncryptionPolicy.NoEncryption is obsolete // Defaults to EncryptionPolicy.RequireEncryption EncryptionPolicy = EncryptionPolicy.NoEncryption, +#pragma warning restore SYSLIB0040 // Defaults to null RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true, // Defaults to null diff --git a/src/Servers/Kestrel/Kestrel/test/ConfigurationReaderTests.cs b/src/Servers/Kestrel/Kestrel/test/ConfigurationReaderTests.cs index cd2f10cbd267..5521121b40a5 100644 --- a/src/Servers/Kestrel/Kestrel/test/ConfigurationReaderTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/ConfigurationReaderTests.cs @@ -31,8 +31,8 @@ public void ReadCertificatesWhenEmptyCertificatesSection_ReturnsEmptyCollection( { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Certificates", ""), - }).Build(); + new KeyValuePair("Certificates", ""), + }).Build(); var reader = new ConfigurationReader(config); var certificates = reader.Certificates; Assert.NotNull(certificates); @@ -44,13 +44,13 @@ public void ReadCertificatesSection_ReturnsCollection() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Certificates:FileCert:Path", "/path/cert.pfx"), - new KeyValuePair("Certificates:FileCert:Password", "certpassword"), - new KeyValuePair("Certificates:StoreCert:Subject", "certsubject"), - new KeyValuePair("Certificates:StoreCert:Store", "certstore"), - new KeyValuePair("Certificates:StoreCert:Location", "cetlocation"), - new KeyValuePair("Certificates:StoreCert:AllowInvalid", "true"), - }).Build(); + new KeyValuePair("Certificates:FileCert:Path", "/path/cert.pfx"), + new KeyValuePair("Certificates:FileCert:Password", "certpassword"), + new KeyValuePair("Certificates:StoreCert:Subject", "certsubject"), + new KeyValuePair("Certificates:StoreCert:Store", "certstore"), + new KeyValuePair("Certificates:StoreCert:Location", "cetlocation"), + new KeyValuePair("Certificates:StoreCert:AllowInvalid", "true"), + }).Build(); var reader = new ConfigurationReader(config); var certificates = reader.Certificates; Assert.NotNull(certificates); @@ -76,9 +76,9 @@ public void ReadCertificatesSection_IsCaseInsensitive() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Certificates:filecert:Path", "/path/cert.pfx"), - new KeyValuePair("CERTIFICATES:FILECERT:PASSWORD", "certpassword"), - }).Build(); + new KeyValuePair("Certificates:filecert:Path", "/path/cert.pfx"), + new KeyValuePair("CERTIFICATES:FILECERT:PASSWORD", "certpassword"), + }).Build(); var reader = new ConfigurationReader(config); var certificates = reader.Certificates; Assert.NotNull(certificates); @@ -223,13 +223,15 @@ public void ReadEndpointWithSingleSslProtocolSet_ReturnsCorrectValue() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), + }).Build(); var reader = new ConfigurationReader(config); var endpoint = reader.Endpoints.First(); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, endpoint.SslProtocols); +#pragma warning restore SYSLIB0039 } [Fact] @@ -237,14 +239,16 @@ public void ReadEndpointWithMultipleSslProtocolsSet_ReturnsCorrectValue() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), - new KeyValuePair("Endpoints:End1:SslProtocols:1", "Tls12"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), + new KeyValuePair("Endpoints:End1:SslProtocols:1", "Tls12"), + }).Build(); var reader = new ConfigurationReader(config); var endpoint = reader.Endpoints.First(); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11 | SslProtocols.Tls12, endpoint.SslProtocols); +#pragma warning restore SYSLIB0039 } [Fact] @@ -252,13 +256,15 @@ public void ReadEndpointWithSslProtocolSet_ReadsCaseInsensitive() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:SslProtocols:0", "TLS11"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:SslProtocols:0", "TLS11"), + }).Build(); var reader = new ConfigurationReader(config); var endpoint = reader.Endpoints.First(); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, endpoint.SslProtocols); +#pragma warning restore SYSLIB0039 } [Fact] @@ -266,8 +272,8 @@ public void ReadEndpointWithNoSslProtocolSettings_ReturnsNull() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + }).Build(); var reader = new ConfigurationReader(config); var endpoint = reader.Endpoints.First(); @@ -279,8 +285,8 @@ public void ReadEndpointWithEmptySniSection_ReturnsEmptyCollection() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + }).Build(); var reader = new ConfigurationReader(config); @@ -294,9 +300,9 @@ public void ReadEndpointWithEmptySniKey_Throws() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:Sni::Protocols", "Http1"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:Sni::Protocols", "Http1"), + }).Build(); var reader = new ConfigurationReader(config); var end1Ex = Assert.Throws(() => reader.Endpoints); @@ -309,13 +315,13 @@ public void ReadEndpointWithSniConfigured_ReturnsCorrectValue() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:Protocols", "Http1"), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:SslProtocols:0", "Tls12"), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:Path", "/path/cert.pfx"), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:Password", "certpassword"), - new KeyValuePair("Endpoints:End1:SNI:*.example.org:ClientCertificateMode", "AllowCertificate"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:Protocols", "Http1"), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:SslProtocols:0", "Tls12"), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:Path", "/path/cert.pfx"), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:Password", "certpassword"), + new KeyValuePair("Endpoints:End1:SNI:*.example.org:ClientCertificateMode", "AllowCertificate"), + }).Build(); var reader = new ConfigurationReader(config); @@ -338,12 +344,14 @@ public void ReadEndpointDefaultsWithSingleSslProtocolSet_ReturnsCorrectValue() { var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("EndpointDefaults:SslProtocols:0", "Tls11"), - }).Build(); + new KeyValuePair("EndpointDefaults:SslProtocols:0", "Tls11"), + }).Build(); var reader = new ConfigurationReader(config); var endpoint = reader.EndpointDefaults; +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, endpoint.SslProtocols); +#pragma warning restore SYSLIB0039 } [Fact] diff --git a/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs b/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs index 27ea07e4a6f7..04361234ee14 100644 --- a/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs @@ -40,8 +40,8 @@ public void ConfigureNamedEndpoint_OnlyRunForMatchingConfig() var serverOptions = CreateServerOptions(); var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:Found:Url", "http://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:Found:Url", "http://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("Found", endpointOptions => found = true) .Endpoint("NotFound", endpointOptions => throw new NotImplementedException()) @@ -101,8 +101,8 @@ public void Configure_IsReplaceable() var serverOptions = CreateServerOptions(); var config1 = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + }).Build(); serverOptions.Configure(config1) .LocalhostEndpoint(5001, endpointOptions => run1 = true); @@ -112,8 +112,8 @@ public void Configure_IsReplaceable() var run2 = false; var config2 = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End2:Url", "http://*:5002"), - }).Build(); + new KeyValuePair("Endpoints:End2:Url", "http://*:5002"), + }).Build(); serverOptions.Configure(config2) .LocalhostEndpoint(5003, endpointOptions => run2 = true); @@ -147,8 +147,8 @@ public void ConfigureDefaultsAppliesToNewConfigureEndpoints() var ran2 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -191,8 +191,8 @@ public void ConfigureEndpointDefaultCanEnableHttps() var ran2 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -262,10 +262,10 @@ public void ConfigureEndpoint_ThrowsWhen_The_PasswordIsMissing() var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - new KeyValuePair("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), - new KeyValuePair("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")) - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + new KeyValuePair("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), + new KeyValuePair("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")) + }).Build(); var ex = Assert.Throws(() => { @@ -286,11 +286,11 @@ public void ConfigureEndpoint_ThrowsWhen_TheKeyDoesntMatchTheCertificateKey() var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - new KeyValuePair("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), - new KeyValuePair("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-ecdsa.key")), - new KeyValuePair("Certificates:Default:Password", "aspnetcore") - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + new KeyValuePair("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), + new KeyValuePair("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-ecdsa.key")), + new KeyValuePair("Certificates:Default:Password", "aspnetcore") + }).Build(); var ex = Assert.Throws(() => { @@ -375,10 +375,10 @@ public void ConfigureEndpoint_CanLoadPemCertificates(string certificateFile, str var ran1 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - new KeyValuePair("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", certificateFile)), - new KeyValuePair("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", certificateKey)), - } + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + new KeyValuePair("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", certificateFile)), + new KeyValuePair("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", certificateKey)), + } .Concat(password != null ? new[] { new KeyValuePair("Certificates:Default:Password", password) } : Array.Empty>())) .Build(); @@ -409,8 +409,8 @@ public void ConfigureEndpointDevelopmentCertificateGetsIgnoredIfPasswordIsNotCor var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Certificates:Development:Password", "12341234"), - }).Build(); + new KeyValuePair("Certificates:Development:Password", "12341234"), + }).Build(); serverOptions .Configure(config) @@ -465,46 +465,46 @@ public void ConfigureEndpoint_ThrowsWhen_HttpsConfigIsDeclaredInNonHttpsEndpoint var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - // We shouldn't need to specify a real cert, because KestrelConfigurationLoader should check whether the endpoint requires a cert before trying to load it. - new KeyValuePair("Endpoints:End1:Certificate:Path", "fakecert.pfx"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + // We shouldn't need to specify a real cert, because KestrelConfigurationLoader should check whether the endpoint requires a cert before trying to load it. + new KeyValuePair("Endpoints:End1:Certificate:Path", "fakecert.pfx"), + }).Build(); var ex = Assert.Throws(() => serverOptions.Configure(config).Load()); Assert.Equal(CoreStrings.FormatEndpointHasUnusedHttpsConfig("End1", "Certificate"), ex.Message); config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:Certificate:Subject", "example.org"), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:Certificate:Subject", "example.org"), + }).Build(); ex = Assert.Throws(() => serverOptions.Configure(config).Load()); Assert.Equal(CoreStrings.FormatEndpointHasUnusedHttpsConfig("End1", "Certificate"), ex.Message); config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), + }).Build(); ex = Assert.Throws(() => serverOptions.Configure(config).Load()); Assert.Equal(CoreStrings.FormatEndpointHasUnusedHttpsConfig("End1", "ClientCertificateMode"), ex.Message); config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:SslProtocols:0", SslProtocols.Tls13.ToString()), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:SslProtocols:0", SslProtocols.Tls13.ToString()), + }).Build(); ex = Assert.Throws(() => serverOptions.Configure(config).Load()); Assert.Equal(CoreStrings.FormatEndpointHasUnusedHttpsConfig("End1", "SslProtocols"), ex.Message); config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("Endpoints:End1:Sni:Protocols", HttpProtocols.Http1.ToString()), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("Endpoints:End1:Sni:Protocols", HttpProtocols.Http1.ToString()), + }).Build(); ex = Assert.Throws(() => serverOptions.Configure(config).Load()); Assert.Equal(CoreStrings.FormatEndpointHasUnusedHttpsConfig("End1", "Sni"), ex.Message); @@ -517,9 +517,9 @@ public void ConfigureEndpoint_DoesNotThrowWhen_HttpsConfigIsDeclaredInEndpointDe var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), - new KeyValuePair("EndpointDefaults:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "http://*:5001"), + new KeyValuePair("EndpointDefaults:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), + }).Build(); var (_, endpointsToStart) = serverOptions.Configure(config).Reload(); var end1 = Assert.Single(endpointsToStart); @@ -580,9 +580,9 @@ private void DefaultConfigSectionCanSetProtocols(string input, HttpProtocols exp var ran3 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("EndpointDefaults:Protocols", input), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("EndpointDefaults:Protocols", input), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -650,9 +650,9 @@ private void EndpointConfigSectionCanSetProtocols(string input, HttpProtocols ex var ran3 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Protocols", input), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:Protocols", input), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -701,13 +701,15 @@ public void EndpointConfigureSection_CanSetSslProtocol() var ran2 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, opt.HttpsOptions.SslProtocols); +#pragma warning restore SYSLIB0039 ran1 = true; }) .Load(); @@ -740,13 +742,15 @@ public void EndpointConfigureSection_CanOverrideSslProtocolsFromConfigureHttpsDe var ran1 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:SslProtocols:0", "Tls11"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, opt.HttpsOptions.SslProtocols); +#pragma warning restore SYSLIB0039 ran1 = true; }) .Load(); @@ -767,13 +771,15 @@ public void DefaultEndpointConfigureSection_CanSetSslProtocols() var ran1 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("EndpointDefaults:SslProtocols:0", "Tls11"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("EndpointDefaults:SslProtocols:0", "Tls11"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, opt.HttpsOptions.SslProtocols); +#pragma warning restore SYSLIB0039 ran1 = true; }) .Load(); @@ -790,16 +796,18 @@ public void DefaultEndpointConfigureSection_ConfigureHttpsDefaultsCanOverrideSsl { opt.ServerCertificate = TestResources.GetTestCertificate(); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete Assert.Equal(SslProtocols.Tls11, opt.SslProtocols); +#pragma warning restore SYSLIB0039 opt.SslProtocols = SslProtocols.Tls12; }); var ran1 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("EndpointDefaults:SslProtocols:0", "Tls11"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("EndpointDefaults:SslProtocols:0", "Tls11"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -830,9 +838,9 @@ public void EndpointConfigureSection_CanSetClientCertificateMode() var ran2 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:ClientCertificateMode", "AllowCertificate"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:End1:ClientCertificateMode", "AllowCertificate"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -864,13 +872,13 @@ public void EndpointConfigureSection_CanConfigureSni() var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:Protocols", HttpProtocols.None.ToString()), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:SslProtocols:0", SslProtocols.Tls13.ToString()), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:Path", certPath), - new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:KeyPath", keyPath), - }).Build(); + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:Protocols", HttpProtocols.None.ToString()), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:SslProtocols:0", SslProtocols.Tls13.ToString()), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:Path", certPath), + new KeyValuePair("Endpoints:End1:Sni:*.example.org:Certificate:KeyPath", keyPath), + }).Build(); var (_, endpointsToStart) = serverOptions.Configure(config).Reload(); var end1 = Assert.Single(endpointsToStart); @@ -925,9 +933,9 @@ public void DefaultEndpointConfigureSection_CanSetClientCertificateMode() var ran1 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("EndpointDefaults:ClientCertificateMode", "AllowCertificate"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("EndpointDefaults:ClientCertificateMode", "AllowCertificate"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -955,9 +963,9 @@ public void DefaultEndpointConfigureSection_ConfigureHttpsDefaultsCanOverrideCli var ran1 = false; var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("EndpointDefaults:ClientCertificateMode", "AllowCertificate"), - new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), - }).Build(); + new KeyValuePair("EndpointDefaults:ClientCertificateMode", "AllowCertificate"), + new KeyValuePair("Endpoints:End1:Url", "https://*:5001"), + }).Build(); serverOptions.Configure(config) .Endpoint("End1", opt => { @@ -976,9 +984,9 @@ public void Reload_IdentifiesEndpointsToStartAndStop() var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:A:Url", "http://*:5000"), - new KeyValuePair("Endpoints:B:Url", "http://*:5001"), - }).Build(); + new KeyValuePair("Endpoints:A:Url", "http://*:5000"), + new KeyValuePair("Endpoints:B:Url", "http://*:5001"), + }).Build(); serverOptions.Configure(config).Load(); @@ -988,10 +996,10 @@ public void Reload_IdentifiesEndpointsToStartAndStop() serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:A:Url", "http://*:5000"), - new KeyValuePair("Endpoints:B:Url", "http://*:5002"), - new KeyValuePair("Endpoints:C:Url", "http://*:5003"), - }).Build(); + new KeyValuePair("Endpoints:A:Url", "http://*:5000"), + new KeyValuePair("Endpoints:B:Url", "http://*:5002"), + new KeyValuePair("Endpoints:C:Url", "http://*:5003"), + }).Build(); var (endpointsToStop, endpointsToStart) = serverOptions.ConfigurationLoader.Reload(); @@ -1015,20 +1023,20 @@ public void Reload_IdentifiesEndpointsWithChangedDefaults() var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:DefaultProtocol:Url", "http://*:5000"), - new KeyValuePair("Endpoints:NonDefaultProtocol:Url", "http://*:5001"), - new KeyValuePair("Endpoints:NonDefaultProtocol:Protocols", "Http1AndHttp2"), - }).Build(); + new KeyValuePair("Endpoints:DefaultProtocol:Url", "http://*:5000"), + new KeyValuePair("Endpoints:NonDefaultProtocol:Url", "http://*:5001"), + new KeyValuePair("Endpoints:NonDefaultProtocol:Protocols", "Http1AndHttp2"), + }).Build(); serverOptions.Configure(config).Load(); serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:DefaultProtocol:Url", "http://*:5000"), - new KeyValuePair("Endpoints:NonDefaultProtocol:Url", "http://*:5001"), - new KeyValuePair("Endpoints:NonDefaultProtocol:Protocols", "Http1AndHttp2"), - new KeyValuePair("EndpointDefaults:Protocols", "Http1"), - }).Build(); + new KeyValuePair("Endpoints:DefaultProtocol:Url", "http://*:5000"), + new KeyValuePair("Endpoints:NonDefaultProtocol:Url", "http://*:5001"), + new KeyValuePair("Endpoints:NonDefaultProtocol:Protocols", "Http1AndHttp2"), + new KeyValuePair("EndpointDefaults:Protocols", "Http1"), + }).Build(); var (endpointsToStop, endpointsToStart) = serverOptions.ConfigurationLoader.Reload(); @@ -1050,9 +1058,9 @@ public void Reload_RerunsNamedEndpointConfigurationOnChange() var config = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:Changed:Url", "http://*:5001"), - new KeyValuePair("Endpoints:Unchanged:Url", "http://*:5000"), - }).Build(); + new KeyValuePair("Endpoints:Changed:Url", "http://*:5001"), + new KeyValuePair("Endpoints:Unchanged:Url", "http://*:5000"), + }).Build(); serverOptions.Configure(config) .Endpoint("Changed", endpointOptions => foundChangedCount++) @@ -1065,9 +1073,9 @@ public void Reload_RerunsNamedEndpointConfigurationOnChange() serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { - new KeyValuePair("Endpoints:Changed:Url", "http://*:5002"), - new KeyValuePair("Endpoints:Unchanged:Url", "http://*:5000"), - }).Build(); + new KeyValuePair("Endpoints:Changed:Url", "http://*:5002"), + new KeyValuePair("Endpoints:Unchanged:Url", "http://*:5000"), + }).Build(); serverOptions.ConfigurationLoader.Reload(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs index 72ee4b008294..4be01e31bbb5 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/TlsTests.cs @@ -47,7 +47,9 @@ public async Task TlsHandshakeRejectsTlsLessThan12() listenOptions.Protocols = HttpProtocols.Http2; listenOptions.UseHttps(_x509Certificate2, httpsOptions => { +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete httpsOptions.SslProtocols = SslProtocols.Tls11 | SslProtocols.Tls12; +#pragma warning restore SYSLIB0039 }); })) { @@ -59,7 +61,9 @@ await sslStream.AuthenticateAsClientAsync(new SslClientAuthenticationOptions TargetHost = "localhost", RemoteCertificateValidationCallback = (_, __, ___, ____) => true, ApplicationProtocols = new List { SslApplicationProtocol.Http2, SslApplicationProtocol.Http11 }, +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete EnabledSslProtocols = SslProtocols.Tls11, // Intentionally less than the required 1.2 +#pragma warning restore SYSLIB0039 }, CancellationToken.None); var reader = PipeReaderFactory.CreateFromStream(PipeOptions.Default, sslStream, CancellationToken.None); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs index 1756a3ba940c..e2bedfcf36ac 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs @@ -384,8 +384,10 @@ void ConfigureListenOptions(ListenOptions listenOptions) using (var connection = server.CreateConnection()) { var stream = OpenSslStream(connection.Stream); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete await Assert.ThrowsAsync(() => stream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.Tls12 | SslProtocols.Tls11, false)); +#pragma warning restore SYSLIB0039 Assert.Equal(1, selectorCalled); } } @@ -444,8 +446,10 @@ void ConfigureListenOptions(ListenOptions listenOptions) using (var connection = server.CreateConnection()) { var stream = OpenSslStream(connection.Stream); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete await Assert.ThrowsAsync(() => stream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.Tls12 | SslProtocols.Tls11, false)); +#pragma warning restore SYSLIB0039 Assert.Equal(1, selectorCalled); } } @@ -702,7 +706,9 @@ void ConfigureListenOptions(ListenOptions listenOptions) var clientOptions = new SslClientAuthenticationOptions() { TargetHost = Guid.NewGuid().ToString(), +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete EnabledSslProtocols = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, +#pragma warning restore SYSLIB0039 }; clientOptions.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; @@ -964,7 +970,9 @@ void ConfigureListenOptions(ListenOptions listenOptions) { listenOptions.UseHttps(options => { +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete options.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11; +#pragma warning restore SYSLIB0039 options.ServerCertificate = _x509Certificate2; options.ClientCertificateMode = ClientCertificateMode.RequireCertificate; options.AllowAnyClientCertificate(); @@ -979,8 +987,10 @@ void ConfigureListenOptions(ListenOptions listenOptions) using (var connection = server.CreateConnection()) { var stream = OpenSslStreamWithCert(connection.Stream); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete var ex = await Assert.ThrowsAnyAsync( async () => await stream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.Tls, false)); +#pragma warning restore SYSLIB0039 } } } diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs index 8714d7e410e6..0cba39d6da11 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs @@ -638,6 +638,7 @@ public async Task ClientAttemptingToUseUnsupportedProtocolIsLoggedAsDebug() var loggerProvider = new HandshakeErrorLoggerProvider(); LoggerFactory.AddProvider(loggerProvider); +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), listenOptions => @@ -658,6 +659,7 @@ await Assert.ThrowsAnyAsync(() => checkCertificateRevocation: false)); } } +#pragma warning restore SYSLIB0039 await loggerProvider.FilterLogger.LogTcs.Task.DefaultTimeout(); Assert.Equal(1, loggerProvider.FilterLogger.LastEventId); diff --git a/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Parser.cs b/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Parser.cs index 6b60c48eb81f..2828e8979458 100644 --- a/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Parser.cs +++ b/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Parser.cs @@ -121,7 +121,7 @@ private static bool IsExtensionClassSignatureValid(ClassDeclarationSyntax syntax var hasPartialModifier = false; foreach (var modifier in syntax.Modifiers) { - if (modifier.Kind() == SyntaxKind.PartialKeyword) + if (modifier.IsKind(SyntaxKind.PartialKeyword)) { hasPartialModifier = true; } diff --git a/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubServerProxyGenerator.Parser.cs b/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubServerProxyGenerator.Parser.cs index fa1e06cca9cc..de571f767ddd 100644 --- a/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubServerProxyGenerator.Parser.cs +++ b/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubServerProxyGenerator.Parser.cs @@ -111,7 +111,7 @@ private static bool IsExtensionClassSignatureValid(ClassDeclarationSyntax syntax var hasPartialModifier = false; foreach (var modifier in syntax.Modifiers) { - if (modifier.Kind() == SyntaxKind.PartialKeyword) + if (modifier.IsKind(SyntaxKind.PartialKeyword)) { hasPartialModifier = true; }