简体   繁体   中英

Curl - error 60 - GuzzleHttp

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?

这可能与Guzzle和HTTPS中的问题相同-请在https://stackoverflow.com/a/29588396/413531上查看我的答案,并检查是否明确提供新下载的cacert.pem文件可以解决您的问题(请仔细检查该文件的路径有效!)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM