根据 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>
<httpRuntime targetFramework="4.7.2" />
也可以起作用。 - Tsahi Asher