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

问题描述:

大家好,



我收到此异常请求已中止:无法创建SSL / TLS安全通道。在ExpressCheckout的下一行。

pp_response =(SetExpressCheckoutResponseType)caller.Call(SetExpressCheckout,pp_request);

在版本53.0的paypal沙箱环境中使用



有谁知道如何解决它?请与我分享。



谢谢

Hi All,

I am getting this exception "The request was aborted: Could not create SSL/TLS secure channel." at the time of ExpressCheckout at following line.
pp_response = (SetExpressCheckoutResponseType)caller.Call("SetExpressCheckout", pp_request);
using in the paypal sandbox Environment in version 53.0

Is anybody there who have any idea how to resolve it? Please Share with me.

Thanks

永远不要接受来自不安全网站的代码处理任何与真钱有关的事情。

你不知道是谁给你代码,你不知道它做了什么,你不知道它把钱正确地放到了适当的账户里,没有将细节传递给任何第三方。



只能从Paypal自己获取此类代码 - 否则欺诈的范围太大。请记住,如果您的行为被视为疏忽,您本人可能要对任何损失承担责任 - 从公共论坛获取您的代码肯定会是!
Never, ever, accept code from a insecure website to handle anything to do with real money.
You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third parties.

Only get such code from Paypal themselves - the scope for fraud otherwise is far too large. And remember, you personally could be liable for any monies lost if your action is seen to be negligent - which getting your code from a public forum would most certainly be!


我也面临着同样的问题。后来我通过大量分析得知Paypal已升级其TLS协议(根据链接)。



现在对于.NET 4.5及更高版本,我们可以将http webrequest协议设置为TLS 1.2更高,但.NET 4或更低版本不支持TLS1以上的TLS。因此修复程序直接为TLS1.2分配端口



I was also facing the same problem. Later i come to know after lots of analysis that Paypal has upgraded its TLS protocols(as per Link ).

Now for .NET 4.5 and higher, we can set the http webrequest protocol to TLS 1.2 to higher but .NET 4 or lower doesn't support TLS above TLS1. Hence the fix is directly assign the port for TLS1.2

ServicePointManager.Expect100Continue = true;
              ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
              ServicePointManager.DefaultConnectionLimit = 9999;

              OAuthTokenCredential tokenCredential = new OAuthTokenCredential(ConfigurationManager.AppSettings["PayPalClientID"].ToString(), ConfigurationManager.AppSettings["PayPalClientSecret"].ToString());
              string accessToken = tokenCredential.GetAccessToken();