|
1 | 1 | using System.Globalization; |
2 | 2 | using System.Net; |
| 3 | +using System.Net.Security; |
3 | 4 | using System.Reflection; |
| 5 | +using System.Security.Authentication; |
4 | 6 | using System.Security.Claims; |
5 | 7 | using System.Threading.RateLimiting; |
6 | 8 | using Htmx.TagHelpers; |
@@ -69,13 +71,37 @@ internal partial class ApiService : ApplicationService<ServerContext, IApiServic |
69 | 71 |
|
70 | 72 | ApplicationContext.Context.Value?.Logger.LogInformation($"Launching Intersect REST API in '{builder.Environment.EnvironmentName}' mode..."); |
71 | 73 |
|
| 74 | + builder.WebHost.ConfigureKestrel( |
| 75 | + ko => |
| 76 | + { |
| 77 | + ko.ConfigureHttpsDefaults( |
| 78 | + hcao => |
| 79 | + { |
| 80 | + // hcao.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13; |
| 81 | + hcao.SslProtocols = SslProtocols.Tls12; |
| 82 | + hcao.OnAuthenticate += (context, options) => |
| 83 | + { |
| 84 | + options.AllowRenegotiation = true; |
| 85 | + options.CipherSuitesPolicy = new CipherSuitesPolicy( |
| 86 | + [ |
| 87 | + TlsCipherSuite.TLS_AES_128_GCM_SHA256, |
| 88 | + TlsCipherSuite.TLS_AES_256_GCM_SHA384, |
| 89 | + TlsCipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, |
| 90 | + ] |
| 91 | + ); |
| 92 | + }; |
| 93 | + } |
| 94 | + ); |
| 95 | + } |
| 96 | + ); |
| 97 | + |
72 | 98 | var updateServerSection = builder.Configuration.GetSection(GetOptionsName<UpdateServerOptions>()); |
73 | 99 | builder.Services.Configure<UpdateServerOptions>(updateServerSection); |
74 | 100 |
|
75 | 101 | // I can't get System.Text.Json to deserialize an array as non-null, and it totally ignores |
76 | 102 | // the JsonConverter attribute I tried putting on it, so I am just giving up and doing this |
77 | 103 | // to make sure the array is not null in the event that it is empty. |
78 | | - configuration.StaticFilePaths ??= new List<StaticFilePathOptions>(); |
| 104 | + configuration.StaticFilePaths ??= []; |
79 | 105 |
|
80 | 106 | var tokenGenerationOptionsSection = |
81 | 107 | apiConfigurationSection.GetRequiredSection(nameof(TokenGenerationOptions)); |
|
0 commit comments