php - Google doesnt work on https but it work on http -
i using api of google send push notificacion, issue if use "http://android.googleapis.com/gcm/send" works perfect if use "https://android.googleapis.com/gcm/send" (with s on http) doesnt work , curl stop.
anyone knows why?
$headers = array('authorization:key=' . $apikey); $ch = curl_init(); curl_setopt($ch, curlopt_url, "http://android.googleapis.com/gcm/send"); if ($headers) curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($ch, curlopt_returntransfer, true);
i response in both cases :
<?php ini_set('display_errors', true); error_reporting(-1); function o($url) { $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_httpheader, ['authorization:key=123']); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, [1,2,3]); curl_setopt($ch, curlopt_returntransfer, true); $output = curl_exec($ch); curl_close($ch); return $output; } var_dump( o("http://android.googleapis.com/gcm/send") ); var_dump( o("https://android.googleapis.com/gcm/send") ); so have error somewhere.
Comments
Post a Comment