PayPal在localhost上运行正常,但在aws服务器上运行时失败

时间:2016-02-03 13:11:57

标签: asp.net-mvc-4 amazon-web-services paypal paypal-sandbox aws-ec2

我已将paypal集成到我的MVC4应用程序中。 PayPal dll版本1.5.0.0,NewtonJson dll版本6.0.0.0 起初我在获取访问令牌

时在localhost处获得异常
Dictionary<string, string> sdkConfig = new Dictionary<string, string>();
sdkConfig.Add("mode", "sandbox");
string accessToken = new PayPal.Api.OAuthTokenCredential("MyClientId", "MySecretId", sdkConfig).GetAccessToken();

例外是

Invalid HTTP response: The request was aborted: Could not create SSL/TLS secure channel.

从stackoverflow我得到了一个修复

System.Net.ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
System.Net.ServicePointManager.DefaultConnectionLimit = 9999;

它目前在我的localhost上工作正常,但在AWS窗口实例上传和运行时会出现异常。

Retried 3 times.... Exception in PayPal.HttpConnection.Execute(). Check log for more details.

有人可以帮我吗?

更新

我已经检查过在mochahost服务器上传相同的代码。它也完美地工作 我的EC2实例是Windows Server 2008 DataCenter,32位,IIS7

1 个答案:

答案 0 :(得分:0)

确保在您使用的任何弹性负载平衡器(ELB)上以及分配给EC2实例的安全组中打开TCP443。在操作系统中,确保Windows高级防火墙允许使用TCP443。

相关问题