Skip to content

Commit 0c71941

Browse files
committed
move around code
1 parent 5ecd3cf commit 0c71941

File tree

8 files changed

+42
-32
lines changed

8 files changed

+42
-32
lines changed

src/BenchmarksApps.sln

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpSys", "BenchmarksApps\T
7272
EndProject
7373
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kestrel", "BenchmarksApps\TLS\Kestrel\Kestrel.csproj", "{291DCDF7-4B7C-D687-A62B-9DF7DF50F2F2}"
7474
EndProject
75-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "BenchmarksApps\TLS\Shared\Shared.csproj", "{C7A7E484-F1DB-4A46-B8F8-4895C413F680}"
76-
EndProject
7775
Global
7876
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7977
Debug_Database|Any CPU = Debug_Database|Any CPU
@@ -282,14 +280,6 @@ Global
282280
{291DCDF7-4B7C-D687-A62B-9DF7DF50F2F2}.Release_Database|Any CPU.Build.0 = Release_Database|Any CPU
283281
{291DCDF7-4B7C-D687-A62B-9DF7DF50F2F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
284282
{291DCDF7-4B7C-D687-A62B-9DF7DF50F2F2}.Release|Any CPU.Build.0 = Release|Any CPU
285-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Debug_Database|Any CPU.ActiveCfg = Debug_Database|Any CPU
286-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Debug_Database|Any CPU.Build.0 = Debug_Database|Any CPU
287-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
288-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Debug|Any CPU.Build.0 = Debug|Any CPU
289-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Release_Database|Any CPU.ActiveCfg = Release_Database|Any CPU
290-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Release_Database|Any CPU.Build.0 = Release_Database|Any CPU
291-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Release|Any CPU.ActiveCfg = Release|Any CPU
292-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680}.Release|Any CPU.Build.0 = Release|Any CPU
293283
EndGlobalSection
294284
GlobalSection(SolutionProperties) = preSolution
295285
HideSolutionNode = FALSE
@@ -307,7 +297,6 @@ Global
307297
{D6616E03-A2DA-4929-AD28-595ECC4C004D} = {B6DB234C-8F80-4160-B95D-D70AFC444A3D}
308298
{455942DF-6C8E-4054-AF1D-41A10BE1466F} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
309299
{291DCDF7-4B7C-D687-A62B-9DF7DF50F2F2} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
310-
{C7A7E484-F1DB-4A46-B8F8-4895C413F680} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
311300
EndGlobalSection
312301
GlobalSection(ExtensibilityGlobals) = postSolution
313302
SolutionGuid = {117072DC-DE12-4F74-90CA-692FA2BE8DCB}

src/BenchmarksApps/TLS/Shared/ConfigurationHelpers.cs renamed to src/BenchmarksApps/TLS/HttpSys/ConfigurationHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Security.Authentication;
22

3-
namespace Shared
3+
namespace HttpSys
44
{
5-
public static class ConfigurationHelpers
5+
internal static class ConfigurationHelpers
66
{
77
public static SslProtocols ParseSslProtocols(string? supportedTlsVersions)
88
{

src/BenchmarksApps/TLS/HttpSys/HttpSys.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

9-
<ItemGroup>
10-
<ProjectReference Include="..\Shared\Shared.csproj" />
11-
</ItemGroup>
12-
139
<ItemGroup>
1410
<None Update="testCert.pfx">
1511
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/BenchmarksApps/TLS/HttpSys/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using HttpSys;
22
using Microsoft.AspNetCore.Connections.Features;
33
using Microsoft.AspNetCore.Server.HttpSys;
4-
using Shared;
54

65
var builder = WebApplication.CreateBuilder(args);
76
builder.Logging.ClearProviders();
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System.Security.Authentication;
2+
3+
namespace Kestrel
4+
{
5+
internal static class ConfigurationHelpers
6+
{
7+
public static SslProtocols ParseSslProtocols(string? supportedTlsVersions)
8+
{
9+
var protocols = SslProtocols.Tls12; // default it TLS 1.2
10+
if (string.IsNullOrEmpty(supportedTlsVersions))
11+
{
12+
return protocols;
13+
}
14+
15+
protocols = SslProtocols.None;
16+
foreach (var version in supportedTlsVersions.Split(','))
17+
{
18+
switch (version.Trim().ToLower())
19+
{
20+
#pragma warning disable SYSLIB0039 // Type or member is obsolete
21+
case "tls11":
22+
protocols |= SslProtocols.Tls11;
23+
break;
24+
#pragma warning restore SYSLIB0039 // Type or member is obsolete
25+
case "tls12":
26+
protocols |= SslProtocols.Tls12;
27+
break;
28+
case "tls13":
29+
protocols |= SslProtocols.Tls13;
30+
break;
31+
default:
32+
throw new ArgumentException($"Unsupported TLS version: {version}");
33+
}
34+
}
35+
36+
return protocols;
37+
}
38+
}
39+
}

src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" Version="9.0.0" />
1111
</ItemGroup>
1212

13-
<ItemGroup>
14-
<ProjectReference Include="..\Shared\Shared.csproj" />
15-
</ItemGroup>
16-
1713
<ItemGroup>
1814
<None Update="testCert.pfx">
1915
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/BenchmarksApps/TLS/Kestrel/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
using System.Net.Security;
33
using System.Security.Authentication;
44
using System.Security.Cryptography.X509Certificates;
5+
using Kestrel;
56
using Microsoft.AspNetCore.Server.HttpSys;
67
using Microsoft.AspNetCore.Server.Kestrel.Core;
78
using Microsoft.AspNetCore.Server.Kestrel.Https;
8-
using Shared;
99

1010
var builder = WebApplication.CreateBuilder(args);
1111
builder.Logging.ClearProviders();

src/BenchmarksApps/TLS/Shared/Shared.csproj

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)