问题描述
直到今天,我的Facebook api在PHP下工作得很好。我没有改变任何东西。但从今天起,我收到以下错误:
有人有一个想法,我如何解决这个错误?
这是因为。
此后脆弱性今天宣布,许多服务暂时关闭了SSLv3,包括Facebook,Facebook Facebook在其PHP SDK中使用SSLv3。
我不知道您有与我相同的Facebook PHP SDK版本,但如果您有base_facebook.php文件,请找到以下行:
$选择[CURLOPT_SSLVERSION] = 3;
并将其更改为一个值t不允许SSLv3():
$ opts [CURLOPT_SSLVERSION] = CURL_SSLVERSION_DEFAULT;
或:
code> $ opts [CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1;
或:
code> $ opts [CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1_0;
这样Facebook API调用将使用TLSv1.0而不是SSLv3。
在我的情况下,这一行在第963行的makeRequest($ url,$ params,$ ch = null)函数中,但是根据您使用的PHP SDK的版本可能会有所不同。 / p>
till today my facebook api under PHP worked well.I did not change anything. But from today on i get the following error:
Has anybody got an idea, how i could solve that error?
It's because of the POODLE: SSLv3.0 vulnerability (CVE-2014-3566).
After this vulnerability was announced today, many services disabled SSLv3 completely for the time being, including Facebook, and it happens that Facebook uses SSLv3 in their PHP SDK.
I am not sure if you have the same Facebook PHP SDK version as me, but if you have the base_facebook.php file, find the line:
$opts[CURLOPT_SSLVERSION] = 3;
And change it to a value that does not allow SSLv3 any longer (find all constants listed):
$opts[CURLOPT_SSLVERSION] = CURL_SSLVERSION_DEFAULT;
or:
$opts[CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1;
or:
$opts[CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1_0;
This way the Facebook API calls will use TLSv1.0 instead of SSLv3.In my case this line is in the "makeRequest($url, $params, $ch=null)" function at line 963, but depending on the version of the PHP SDK you're using it may differ.
这篇关于Facebook API从今天出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!