【发布时间】:2016-05-12 16:59:57
【问题描述】:
我已将 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;
它目前在我的本地主机上运行良好,但在 AWS windows 实例上上传和运行时出现异常。
Retried 3 times.... Exception in PayPal.HttpConnection.Execute(). Check log for more details.
有人可以帮我吗?
更新
我已经检查过在 mochahost 服务器中上传相同的代码。它也在那里完美地工作 我的 EC2 实例是 Windows Server 2008 DataCenter,32 位,带有 IIS7
【问题讨论】:
标签: asp.net-mvc-4 amazon-web-services paypal paypal-sandbox aws-ec2