首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在将PayPal模式设置为‘安全测试-沙箱’之后,如何调试“无法连接到远程服务器”错误?

在将PayPal模式设置为‘安全测试-沙箱’之后,如何调试“无法连接到远程服务器”错误?
EN

Stack Overflow用户
提问于 2017-02-10 18:06:04
回答 1查看 408关注 0票数 0

我在用PayPal .Net SDK。它运行良好,直到我尝试在一个‘实时’web服务器上进行测试,我将模式设置为‘安全测试-沙箱’。

代码语言:javascript
复制
  <paypal>
    <settings>
      <!-- Replace the mode to `security-test-sandbox` to test if your server supports TLSv1.2. For more information follow README instructions.-->
      <add name="mode" value="security-test-sandbox" />

但是现在在C#中,代码的底线是.

代码语言:javascript
复制
    // Returns APIContext object
    public static APIContext GetApiContext()
    {
        // ### Api Context
        // Pass in a `APIContext` object to authenticate 
        // the call and to send a unique request id 
        // (that ensures idempotency). The SDK generates
        // a request id if you do not pass one explicitly.

        var config = getConfig();

        var tokenCredential = new OAuthTokenCredential(clientId, clientSecret, config);
        string accessToken = tokenCredential.GetAccessToken();// this errors

...throws此错误:

PayPal.PayPalException:再试一次.PayPal.HttpConnection.Execute()中的异常。查看日志以获得更多详细信息。

问题是日志没有提供任何有用的信息,只是“无法连接到远程服务器”:

2017-02-10 17:32:41,114 10调试Content-Type:application/x-www-form-urlencoded (null) PayPal.Api.PayPalResource 2017-02-10 17:32:41,130 10调试(lang=DOTNET;v=4.5.1;clr=4.0.30319.42000;bit=64;os=Microsoft PayPal.Api.PayPalResource (null)用户代理:PayPalSDK/PayPal SDK 1.8.0 Windows NT 6.3.9600.0 2017-02-10 17:32:41,130 10调试PayPal.Api.PayPalResource (null)授权:基本QVV...MT3A= 2017-02-10 17:32:41,130 10调试PayPal.Api.PayPalResource (null) PayPal.Api.PayPalResource 2017-02-10 17:32:42,594 10错误PayPal.Api.HttpConnection (null)无法连接到远程服务器 2017-02-10 17:32:42,594 10调试PayPal.Api.HttpConnection (null)连接服务器时出现问题: ConnectFailure ..。

我使用自签名证书在web服务器上设置了HTTPS和cloudflare。

google开发工具中的安全细节

安全性应该足以连接到PayPal,但我仍然无法。

我在IIS中启用了登录到FailedReqLogFiles,虽然有一个条目为失败的请求,它说“没有发现错误或警告”在日志的“错误和警告”部分。

我怎么知道出了什么问题?

EN

回答 1

Stack Overflow用户

发布于 2017-02-13 15:14:50

不再支持“安全-测试-沙箱”模式(自述更新)。

将模式设置为“live”或“sandbox”,就像预期的那样。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42165931

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档