小编chi*_*tra的帖子

请求已中止:无法创建SSL/TLS安全channel.System.Net.WebException

我正在使用NopCommerce的PayPalStandard插件.当我在paypal成功付款后下订单并使用paypalstandard插件付款时,它会重定向到商家网站.那时它给出了错误:

请求已中止:无法创建SSL/TLS安全通道.

我也使用Paypal的Sandbox帐户进行测试.

它从这一行抛出错误:

var sw = new StreamWriter(req.GetRequestStream()
Run Code Online (Sandbox Code Playgroud)

这是下面的代码:

var req = (HttpWebRequest)WebRequest.Create(GetPaypalUrl());
        req.Method = "POST";
        req.ContentType = "application/x-www-form-urlencoded";
        req.ProtocolVersion = HttpVersion.Version10;

        string formContent = string.Format("cmd=_notify-synch&at={0}&tx={1}", _paypalStandardPaymentSettings.PdtToken, tx);
        req.ContentLength = formContent.Length;

        using (var sw = new StreamWriter(req.GetRequestStream(), Encoding.ASCII))
            sw.Write(formContent);
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc paypal paypal-sandbox nopcommerce

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

asp.net-mvc ×1

nopcommerce ×1

paypal ×1

paypal-sandbox ×1