問題描述
我使用 Facebook SDK for PHP v2.0 的應用在過去 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/1232123Facebook 禁用了 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;
如果您可以使用它而不會經常出錯,那就可以了.如果你的php版本低于5.5,把這兩行注釋掉就可以了.
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');
這篇關于Facebook SDK for PHP 錯誤 - CurlException:35:錯誤:14094410:SSL 例程:SSL3_READ_BYTES:sslv3 警報握手失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!