最近因为安全性要求:将所有域名TLS版本限制为1.2才能访问,禁用了之前的1.0和1.1。但是在.net后台进行请求时报错“请求被中止: 未能创建 SSL/TLS 安全通道”
通过以下方式解决:文章源自IT老刘-https://itlao6.com/6226.html
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; 文章源自IT老刘-https://itlao6.com/6226.html
文章源自IT老刘-https://itlao6.com/6226.html文章源自IT老刘-https://itlao6.com/6226.html具体原理参考微软官方文档:文章源自IT老刘-https://itlao6.com/6226.htmlhttps://docs.microsoft.com/zh-cn/dotnet/api/system.net.servicepointmanager.securityprotocol?view=net-5.0 文章源自IT老刘-https://itlao6.com/6226.htmlhttps://support.microsoft.com/zh-cn/topic/%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E4%B8%80%E5%8F%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%8D%87%E7%BA%A7%E5%88%B0-net-framework-4-6-%E5%90%8E%E4%BD%BF%E7%94%A8-servicepointmanager-%E6%88%96-sslstream-api-1e3a9788-ab0d-7794-204b-6c4678bc5ed5文章源自IT老刘-https://itlao6.com/6226.html
评论