Cannot set app to use system default TLS version by adding appcontext settings in web.config

不问归期 提交于 2019-12-20 01:43:14

问题


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.

This is the config I add.

<runtime>
   <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false;Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>
</runtime>

回答1:


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



来源:https://stackoverflow.com/questions/51807326/cannot-set-app-to-use-system-default-tls-version-by-adding-appcontext-settings-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!