判断windows版本

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

View File

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