请求被中止: 未能创建 SSL/TLS 安全通道,设置 TLSv1.2和TLSv1.1版本 .基础链接已经关闭,发送时发生错误

WSO2 API访问的安全要求, 只能提供TLSv1.2和TLSv1.1版本,其它SSL版本协议因为存在较高安全漏洞问题会被disable。
A 改成TLSv1.1或TLSv1.2,最好使用TLSv1.2。 这个要升级TLS版本

请求被中止: 未能创建 SSL/TLS 安全通道,设置  TLSv1.2和TLSv1.1版本 .基础链接已经关闭,发送时发生错误


 
if (url.StartsWith("https")) System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;


HttpWebRequest req = (HttpWebRequest)WebRequest.Create(serverURL);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
strNewValue = "cmd=_notify-synch&tx=" + System.Web.HttpContext.Current.Request.QueryString["tx"] + "&at=" + PayPalParameter.BusinessToken;

原文地址:https://www.cnblogs.com/suizhikuo/p/8920709.html