如果IIS上没有绑定证书,那么Request请求会出现 “未能为 SSL/TLS 安全通道建立信任关系” 这个错误;
解决办法:在请求前面加上两行代码
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;