首页 > 其他 > 详细

请求被中止: 未能创建 SSL/TLS 安全通道

时间:2018-04-24 20:49:56      阅读:195      评论:0      收藏:0      [点我收藏+]

出现“请求被中止: 未能创建 SSL/TLS 安全通道。”的问题。

在创建请求地址的前面加了这句代码就可以了

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

代码示例:

 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;

请求被中止: 未能创建 SSL/TLS 安全通道

原文:https://www.cnblogs.com/kekelele/p/8933442.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!