ios,php推送报错


php已经加载openssl模块,防火墙关闭,报错如下:

   
  Warning: stream_socket_client() [function.stream-socket-client]: Unable to set local cert chain file `ck.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /web1/app/testdeom.php on line 31
  

Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /web1/app/testdeom.php on line 31

Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /web1/app/testdeom.php on line 31

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /web1/app/testdeom.php on line 31
Failed to connect: 0

ios php

liuxue 11 years, 11 months ago
   
  class pushNotifications {
  
...
private $sslPem = 'cert.pem';
...
function connectToAPNS(){
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', dirname(__FILE__) . '/' . $this->sslPem);

参照: http://stackoverflow.com/a/809697/841070

Mioori answered 11 years, 11 months ago

Your Answer