卷曲错误:SSL连接错误

时间:2016-03-15 13:04:37

标签: php ssl curl paypal

当我尝试使用Paypal api进行付款时,会产生此错误 '卷曲错误:SSL连接错误'
- PHP版本5.4
但相同的代码在我的本地机器上工作,我在本地机器上有PHP 5.6 - 这个或其他方面有版本问题吗?

  • 我的卷曲代码是
    /**
     * Additional information for this client, not needed by the vanilla OAuth protocol but might be useful, for example,
     * for storing descriptive information.
     * 
     * @return a map of additional information
     */
    Map<String, Object> getAdditionalInformation();
    

1 个答案:

答案 0 :(得分:1)

您应该使用

获取实际的错误代码
echo curl_errno($curl); // It might display a '59'

查找&#39; 59&#39;在https://curl.haxx.se/libcurl/c/libcurl-errors.html CURLE_SSL_CIPHER(59),阅读有关错误的信息,然后研究如何修复错误。

可能的解决方法

根据https://stackoverflow.com/a/4073567,你应该尝试:

curl_setopt($curl, CURLOPT_SSLVERSION, 3);

这有潜在危险,因为它会强制使用SSL3。