解决基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。

如果IIS上没有绑定证书,那么Request请求会出现 “未能为 SSL/TLS 安全通道建立信任关系” 这个错误;

解决办法:在请求前面加上两行代码

 ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
 ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
原文地址:https://www.cnblogs.com/liuzheng0612/p/13912854.html