我正在开发一个Facebook画布应用程序,有时(一周内3次)我收到此错误(说实话,这次是用户收到错误):
Fatal error: Uncaught CurlException: 52: GnuTLS recv error (-12): A TLS fatal alert has been received. thrown in /myURL/facebook-php-sdk-master/src/base_facebook.php on line 1031
myURL是我的应用程序的原始地址(不是apps.facebook.com)的URL。
我找不到这个错误的含义,我唯一可以猜到的是它是关于加密的东西,因此是TLS。
一个可能的事情(我再次猜测)是应用程序在HTTPS子域上运行,但我们的主域是普通的HTTP。每次应用程序运行时,控制台都会显示错误:
Refused to connect to 'http://www.someURL.hu/' because it violates the following Content Security Policy directive: "connect-src https://*.facebook.com http://*.facebook.com https://*.fbcdn.net http://*.fbcdn.net *.facebook.net *.spotilocal.com:* https://*.akamaihd.net ws://*.facebook.com:* http://*.akamaihd.net https://fb.scanandcleanlocal.com:* *.atlassolutions.com https://*.internet.org http://*.internet.org http://attachment.fbsbx.com https://attachment.fbsbx.com".
但是整个时间就是这样,Chrome在HTTPS图标上显示警告,说明了128位加密和TLS(< - 我猜测的主要提示)。
base_facebook.php的correspongin部分如下:
// With dual stacked DNS responses, it's possible for a server to
// have IPv6 enabled but not have IPv6 connectivity. If this is
// the case, curl will try IPv4 first and if that fails, then it will
// fall back to IPv6 and the error EHOSTUNREACH is returned by the
// operating system.
if ($result === false && empty($opts[CURLOPT_IPRESOLVE])) {
...
//(AND THE FOLLOWING LINE HERE IS THE ONE THE ERROR IS MENTIONING:
if ($result === false) {
$e = new FacebookApiException(array(
'error_code' => curl_errno($ch),
'error' => array(
'message' => curl_error($ch),
'type' => 'CurlException',
),
));
curl_close($ch);
throw $e;
}
curl_close($ch);
return $result;
}
什么可能导致此错误?这是什么意思?我从未见过这样的事情。它似乎完全随机发生。
提前致谢。