I'm developing a Facebook canvas application and sometimes (3 times in one week) I get this error (to be honest, this time it's a user getting the error):
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 is the URL of my application's original address (not the apps.facebook.com one).
I can't find the meaning of this error, the only thing I could guess is that it's something about encryptions, hence the TLS.
One possible thing (I'm guessing again) is that the application is running on an HTTPS subdomain, but our main domain is normal HTTP. The console is showing an error every time the app runs:
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".
But this was like this the whole time and Chrome is showing a warning on the HTTPS icon, saying something about 128-bit encryption and TLS (<-- my main hint in guessing).
The correspongin part of the base_facebook.php is the following:
// 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;
}
What can cause this error? What does it mean? I've never seen anything like this. And it seems it occurs totally randomly.
Thanks in advance.