Facebook SDK for PHP错误 - CurlException:35:错误:14094410:SSL例程:SSL3_READ_BYTES:sslv3警报握手失败
我的应用程式使用PHP SDK 2.0的Facebook SDK已停止工作,因为过去20 - 24小时。我不断从base_facebook.php获取以下错误 -
My app using Facebook SDK for PHP v2.0 stopped working since the past 20 - 24 hours. I keep getting the following error from the base_facebook.php -
CurlException:35:错误:14094410:SSL例程:SSL3_READ_BYTES:sslv3警报握手失败
CurlException: 35: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
通过阅读stackoverflow上的其他线程,我将以下几行代码添加到了base_facebook.php中,但这些都没有帮助。
From reading the other threads on stackoverflow I added the following lines of code to base_facebook.php but none of these help.
$opts[CURLOPT_SSL_VERIFYPEER] = false;
$opts[CURLOPT_SSL_VERIFYHOST] = false;
$opts[CURLOPT_SSLVERSION] = 3;
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
任何建议修复的问题将非常感激。感谢。
Any suggestions to the fix the issue would be highly appreciated. Thanks.
这是因为SSLv3漏洞:
https://access.redhat.com/articles/1232123
Facebook禁用了SSLv3,因此您无法再使用它了。
It's because SSLv3 vulnerbility here: https://access.redhat.com/articles/1232123 Facebook disabled SSLv3 so, you cannot use it anymore.
如果您有php 5.5或5.6,请尝试更改
If you have php 5.5 or 5.6, try change
$opts[CURLOPT_SSLVERSION] = 3;
到
$opts[CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1;
如果你可以使用它没有常量错误,没关系。
If you can use it without constant error, it's ok. If you have php version lower than 5.5, just comment these 2 lines out and it will be fine after that.
$opts[CURLOPT_SSLVERSION] = 3;
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');