判断windows版本

This commit is contained in:
陈国伟 2021-08-03 14:17:33 +08:00
parent 384757b9f5
commit d594f9d794

View File

@ -63,8 +63,11 @@ namespace FastGithub
certService.InstallAndTrustCaCert();
kestrel.Listen(IPAddress.Any, HTTPS_PORT, listen => listen.UseHttps(https =>
{
if (OperatingSystem.IsWindows() && Environment.OSVersion.Version < new Version(6, 2))
{
https.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13;
}
https.ServerCertificateSelector = (ctx, domain) => certService.GetOrCreateServerCert(domain);
}));
}