I have connected GCM
with laravel 5.1
PushNotification through \Zend\Http\
client.
It was working good. But suddenly it stopped working and produce some exceptions
.
My code is like...
$collection = PushNotification::app('appNameAndroid')->to ( $deviceToken );
$collection->adapter->setAdapterParameters(['sslverifypeer' => false]);
$collection->send ( $message );
I also have tried the below codes but none of them are working...
$collection = PushNotification::app('appNameAndroid')->to ( $deviceToken );
$new_client = new \Zend\Http\Client(null, array(
'adapter' => 'Zend\Http\Client\Adapter\Socket',
'sslverifypeer' => false
));
$collection->adapter->setHttpClient($new_client);
$collection->send ( $message );
----------------------------and-----------------------------------
$collection = PushNotification::app('appNameAndroid')->to ( $deviceToken );
$collection->adapter->setAdapterParameters(array(
'ssl'=>array(
'verify_peer' => false,
'verify_peer_name' => false)
));
$collection->send ( $message );
The exceptions are...
exception 'ErrorException' with message 'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol' in C:\xampp\htdocs\activ8-webapp\api\vendor\zendframework\zend-http\src\Client\Adapter\Socket.php:281
Next exception 'Zend\Http\Client\Adapter\Exception\RuntimeException' with message 'Unable to enable crypto on TCP connection gcm-http.googleapis.com' in C:\xampp\htdocs\activ8-webapp\api\vendor\zendframework\zend-http\src\Client\Adapter\Socket.php:308