> I'm trying to make work apns-php on my server
>
> I'm getting this error:
>
> +0200 ApnsPHP[3956]: ERROR: Unable to connect to 'ssl://
> gateway.sandbox.push.apple.com:2195': (0) Thu, 29 Sep 2011 10:04:26
> --------------------------------------------------------------------------------------------------------------------
> I have found a solution on stackoverflow as below:
>
> I have found a solution, I don't know if it's the best, but it works.
> On Abstract.php (this file is part of the apns-php source) I have
> commented the line 343. Now it looks like this:
>
> $streamContext = stream_context_create(array('ssl' => array(
> //'verify_peer' => isset($this->_sRootCertificationAuthorityFile),
> 'cafile' => $this->_sRootCertificationAuthorityFile,
> 'local_cert' => $this->_sProviderCertificateFile
> )));
> I really don't know what is the point of this line, but know the push
> notification is working properly. My doubt is if it will work properly
> too on production server. Someone knows?
>
> ----------------------------------------------------------------------------------------------------------------------
> I wanna know what is the reason? and will it work properly too on
> production server?
Please, don't change Abstract.php but simple don't set in your script:
$push->setRootCertificationAuthority('entrust_root_certification_authority.pem');
Maybe in development server you don't have the file entrust_root_certification_authority.pem (or similar).
You can read some useful informations here: http://code.google.com/p/apns-php/wiki/CertificateCreation#Verify_peer_using_Entrust_Root_Certification_Authority
Aldo