通过在web.config中添加appcontext设置,无法将应用设置为使用系统默认的TLS版本 [英] Cannot set app to use system default TLS version by adding appcontext settings in web.config
本文介绍了通过在web.config中添加appcontext设置,无法将应用设置为使用系统默认的TLS版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
According to .net guidance of TLS protocol programming, it suggests to config security via appcontext switch when your project targets on .net 4.6. This way works when add appcontext in app.config for console application. However, it doesn't work when add appconext switch in web.config for website project.
这是我添加的配置.
<runtime>
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false;Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>
</runtime>
推荐答案
AppContext切换Web配置文件中的用法:
AppContext switches usage in web config file:
<appSettings>
<add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSchUseStrongCrypto" value="false" />
<add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSystemDefaultTlsVersions" value="false" />
</appSettings>
https://github.com/dotnet/docs/issues/6675
这篇关于通过在web.config中添加appcontext设置,无法将应用设置为使用系统默认的TLS版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文