ray*_*en3 6 network-programming .net-4.6 tls1.2
根据TLS 协议编程的.net 指南,当您的项目面向 .net 4.6 时,建议通过 appcontext 开关配置安全性。当在 app.config 中为控制台应用程序添加 appcontext 时,这种方式有效。但是,在网站项目的 web.config 中添加 appconext 开关时它不起作用。
这是我添加的配置。
<runtime>
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false;Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>
</runtime>
Run Code Online (Sandbox Code Playgroud)
ray*_*en3 16
AppContext 在 web 配置文件中切换用法:
<appSettings>
<add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSchUseStrongCrypto" value="false" />
<add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSystemDefaultTlsVersions" value="false" />
</appSettings>
Run Code Online (Sandbox Code Playgroud)
https://github.com/dotnet/docs/issues/6675
| 归档时间: |
|
| 查看次数: |
6928 次 |
| 最近记录: |