duanlei2150 2016-12-14 03:37
浏览 78
已采纳

Braintree PHP SDK cURL异常

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.

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

PHP 5.5.3

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

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);

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.

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?

Thanks, Brad.

  • 写回答

2条回答 默认 最新

  • doufang8965 2016-12-19 21:01
    关注

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

    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.

    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.

    The way to do this would be: php -r 'echo json_encode(curl_version(), JSON_PRETTY_PRINT);'

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?