Braintree PHP SDK cURL异常 [英] Braintree PHP SDK cURL exception

查看:249
本文介绍了Braintree PHP SDK cURL异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 Braintree_ClientToken :: generate()生成客户端令牌时,我总是回到 Braintree_Exception_SSLCertificate 异常。我已经加载了SDK,我的PHP设置似乎满足SDK的最低要求。

I keep getting back a Braintree_Exception_SSLCertificate exception when I try to generate a client token using Braintree_ClientToken::generate(). I've got the SDK loaded and my PHP setup seems to meet the minimum requirements for the SDK.

我运行的PHP和cURL的版本是:

The versions of PHP and cURL I'm running are:

PHP 5.5.3

cURL 7.32.0 OpenSSL / 1.0.1e 。 SSL已在我的cURL模块中启用。

cURL 7.32.0 with OpenSSL/1.0.1e. SSL is enabled in my cURL module.

我注意到Braintree正在强制使用TLS 1.2,所以我认为这可能是问题,但我尝试添加以下行到Http.php Braintree SDK:

I noticed Braintree is enforcing TLS 1.2 so I thought that might be the issue but I tried adding the following line to Http.php in the Braintree SDK:

curl_setopt($curl, CURLOPT_SSLVERSION, 6);



这应该设置cURL使用 TLS 1.2 但它似乎没有帮助,我不知道如何验证设置是否生效。

This should set cURL to use TLS 1.2 but it didn't seem to help and I'm not sure how to verify that the setting even took effect.

我没有成功地提出请求Braintree的API,所以我担心这是我做错了,或者说,我使用的cURL的版本是不好的。有没有什么需要启用我错过的SSL?

I haven't managed to successfully place a request to Braintree's API yet so I'm worried this is something I'm doing wrong or maybe the version of cURL I'm using is no good. Is there anything I need to enable SSL that I've missed?

感谢,
Brad。

Thanks, Brad.

推荐答案

全面披露:我在Braintree工作。如果您有任何其他问题,请随时与支持联系。

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

您使用的cURL版本可能是您的问题,因为libcurl版本应该大于7.40。

The cURL version that you are using may be your issue, because the libcurl version should be greater than 7.40. I would recommend updating to this version, since TLS 1.2 support is added at that version and beyond.

此外,此 github链接让您了解Braintree为您的PHP集成使用TLS 1.2的最新版本所需的过程。我提到这一点,因为你想要一个方法来检查你的cURL是否被设置为实例化TLS 1.2。

Also, this github link takes you through the process that Braintree requires for your PHP integration to be up to date with TLS 1.2. I'm mentioning this since you wanted a way to check if your cURL was being set to instantiate TLS 1.2.

这样做的方法是:
php -r'echo json_encode(curl_version(),JSON_PRETTY_PRINT);'

这篇关于Braintree PHP SDK cURL异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆