Completely offline (Thank you cs8425)

This commit is contained in:
Kei-Luna
2026-05-13 06:36:26 +09:00
parent 6740b8ecf7
commit e92b214161
7 changed files with 371 additions and 388 deletions

View File

@@ -23,7 +23,24 @@ public static class SdkServer
webBuilder
.UseStartup<Startup>()
.ConfigureLogging((_, logging) => { logging.ClearProviders(); })
.UseUrls(ConfigManager.Config.HttpServer.GetDisplayAddress());
.ConfigureKestrel(serverOptions =>
{
// Pre-warm cert before first TLS handshake
_ = Utils.CertHelper.GetOrCreate(null);
var bindAddr = System.Net.IPAddress.Parse(ConfigManager.Config.HttpServer.BindAddress);
foreach (var port in new[] { ConfigManager.Config.HttpServer.Port, 13443, 18443, 31443 })
{
serverOptions.Listen(bindAddr, port, o =>
{
o.UseHttps(https =>
{
https.ServerCertificateSelector = (_, sni) =>
Utils.CertHelper.GetOrCreate(sni);
});
});
}
});
});
var host = builder.Build();