lkorth/php-gcm

"Received error code 0 from GCM Service" if no "CURLOPT_SSL_VERIFYPEER" to false

timmy78 opened this issue · 4 comments

Hi

I used the library in local.
When I send a message, I receive the error : "Received error code 0 from GCM Service".

But when in the code I put the option CURLOPT_SSL_VERIFYPEER to false in Sender.php it works.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

Why ?

Thank you !

You may have outdated, or incorrect certificates on the box you're running this from. What is the output of curl https://android.googleapis.com/gcm/send on the same box?

The response is "false" and the status is "0".

How to correct it ?

All the ports are opened.
I used this bundle last time (which use kriswallsmith/buzz lib) and it worked on the box.

Thank you !

You may want to add the verbose flag to see what is happening. curl -v https://android.googleapis.com/gcm/send. It appears that there is an underlying issue with curl and SSL on your box that you will need to fix in order to use curl in PHP securely.

Closing old issue.