I tried to open ssl connection in symfony2. So, i created a service wich call stream_socket_client() method but the connection failed... I do not know if is possible to open a connection in a service ?
Thanks for your help.
I tried to open ssl connection in symfony2. So, i created a service wich call stream_socket_client() method but the connection failed... I do not know if is possible to open a connection in a service ?
Thanks for your help.
// Create SSL context
$ctx = stream_context_create();
// Opening PEM file
$pathCk = $this->kernel->locateResource('@MyBundle/path/ck.pem');
stream_context_set_option($ctx, 'ssl', 'local_cert', $pathCk);
// Opening connection with apple servers
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195',
$err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
I had this error message :
Unable to connect to ssl://gateway.push.apple.com:2195 (Network is unreachable)