I have an ASP.NET Core 2.0 REST server running fine, but I need to restrict access to TLS1.2 - how do I do this? Can't seem to find any documentation on it. Server is running on Kestrel. Thanks!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There's a UseHttps
overload that allows you to provide a HttpsConnectionAdapterOptions
instance to configure this. Here's an example of what this might look like in your case:
listenOptions.UseHttps(new HttpsConnectionAdapterOptions
{
...
SslProtocols = SslProtocols.Tls12
});
For reference, SslProtocols
defaults to SslProtocols.Tls12 | SslProtocols.Tls11
.
回答2:
.net core 2.1 Kestrel config:
.UseKestrel(c =>
{
c.ConfigureHttpsDefaults(opt =>
{
opt.SslProtocols = SslProtocols.Tls12;
});
})