Gia*_*llo 6 c# asp.net .net-core asp.net-core
我有一个运行良好的ASP.NET Core 2.0 REST服务器,但我需要限制对TLS1.2的访问 - 我该怎么做?似乎无法找到任何文档.服务器正在Kestrel上运行.谢谢!
Kir*_*kin 12
有一个UseHttps
重载,允许您提供一个HttpsConnectionAdapterOptions
实例来配置它.以下是您的案例中可能出现的示例:
listenOptions.UseHttps(new HttpsConnectionAdapterOptions
{
...
SslProtocols = SslProtocols.Tls12
});
Run Code Online (Sandbox Code Playgroud)
供参考,SslProtocols
默认为SslProtocols.Tls12 | SslProtocols.Tls11
.
.net 核心 2.1 红隼配置:
.UseKestrel(c =>
{
c.ConfigureHttpsDefaults(opt =>
{
opt.SslProtocols = SslProtocols.Tls12;
});
})
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7165 次 |
最近记录: |