0

What can cause an error 60 for cURL? Certificate is identical to the one used in local environment but raises an error on production.


(original problem)

So I'm trying to integrate Illuminate\Socialize into my app, with a Facebook login. It all seems to work out fine locally, and on my production server I obtain the following error:

RequestException in MultiAdapter.php line 234:
[curl] (#60) See http://curl.haxx.se/libcurl/c/libcurl-errors.html
for an explanation of cURL errors [url]

https://graph.facebook.com/oauth/access_token?client_id={client_id}
&client_secret={secret}&code={code}&redirect_uri={redirect-uri}

It seems that error 60 comes from a certificate error. A few points:

  • My Google module works in production as expected.
  • I'm on shared hosting.
  • The redirect-uri is authorized

Any directions on a solution would be greatly appreciated!


Edit: I managed to make it work twisting Adapter\Curl\CurlFactory.php, adding after curl_init

curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);

Although it is only a quick-fix as it looks insecure. On the same location, I tried adding

curl_setopt($handle, CURLOPT_CAINFO, dirname(__FILE__) . '/../../cacert.pem');

(+verifypeer to true), but it has no effect... anybody?

repptilia
  • 457
  • 8
  • 19

1 Answers1

2

This might be the same problem as in Guzzle and HTTPS - please see my answer at https://stackoverflow.com/a/29588396/413531 and check if explicitly providing a newly downloaded cacert.pem file solves your issue (double check that the path to the file is valid!)

Community
  • 1
  • 1
Hirnhamster
  • 7,101
  • 8
  • 43
  • 73
  • This is indeed how I solved similar issues on the production server. I assumed error was coming from a bug from Socialize, but it looks like I made a mistake. Will try again with a newer version of Socialize and see what's going on. – repptilia Apr 14 '15 at 05:45