.net4.0 请求HTTPS出错:未能创建 SSL/TLS 安全通道

时间:2022-01-23 09:00:20

两种方法:

1.在代码中修改

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;// SecurityProtocolType.Tls1.2;

2.修复注册表

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]

"SchUseStrongCrypto"=dword:00000001

https://*.com/questions/33761919/tls-1-2-in-net-framework-4-0

https://blogs.msdn.microsoft.com/jchiou/2016/05/27/如何在-net-framework-4-0-4-5-以上的程式支援-tls-1-2/