New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195' #29
Comments
Did you see this issue? #24 |
Had this same issue on a bitnami LAMP stack. Thanks for the fix. |
Did you made shure that your pem file contained both a
and a
area? |
Sorry for late response; haven't had time to check this further. The APNs work properly with the fix I posted, so I did not investigate it further. @theoboldt yes, it does contain starting/closing tags. @hshhhhh I haven't seen it prior to posting; if you believe the issues are identical, feel free to close this issue. Thanks! |
I got the same error. $this->_hSocket = @stream_socket_client($sURL, $nError, $sError,
$this->_nConnectTimeout, STREAM_CLIENT_CONNECT, $streamContext); After i remove the "@" before function stream_socket_client(), i got another error: stream_socket_client(): Unable to set private key file `.../dev.pem' I google a lot and follow every step of this guide, make sure my pem file is generated rightly: then i run below command to check is the secure link to apns right or not: openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns-dev-cert.pem -key apns-dev-key.pem -CApath /etc/ssl/certs/Entrust_Root_Certification_Authority.pem Press enter and i got this prompt : Enter pass phrase for apns-dev-key.pem: then i realize that i forgot set passphrase for cert(it is dev.pem in my case) // Instantiate a new ApnsPHP_Push object
$this->push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_SANDBOX,
'dev.pem'
);
// Set the Provider Certificate passphrase
$this->push->setProviderCertificatePassphrase($passphrase);
// Set the Root Certificate Autority to verify the Apple remote peer
$this->push->setRootCertificationAuthority('entrust_root_certification_authority.pem');
// Connect to the Apple Push Notification Service
$this->push->connect();
// Instantiate a new Message with a single recipient
$this->message = new ApnsPHP_Message($deviceToken); set the right passphrase for the apns pem, problem solved. |
I have this problem as well. I've tried every recommendation. using Provides an ok response. My 2195 outgoing port is opened on the server. Checked using telnet response is ok. My php script calls setProviderCertificatePassphrase without a problem I'm not sure where to look for this anymore. My error log sends me to line 334 on Abstract.php which is:
Which is part of the connect function where:
Some help greatly appreciated |
Have you tried to comment two lines as it was recomended? #24 (comment)
|
Issue
The following error is thrown when trying to push notifications from a server:
The issue occurs with the default test scripts coming with the library - e.g.
sample_push_custom.php
.The same code and certificates are working properly when testing in local environment (OSX 10.8.3). This way all notifications are delivered properly.
Temporary solution
Uncommenting the following code in
ApnsPHP/Abstract.php
, line 382, makes error disappear and notifications being delivered properly:Server setup
Ubuntu 12.10, PHP 5.4.6, OpenSSL installed and enabled.
Local machines: OSX 10.8.3 + MAMP, PHP 5.4.10.
Note:
Same issue dating from 2011 has been reported at SO as well:
http://stackoverflow.com/a/6913825/1520477
Let me know if you need any additional details about the server setup.
Thanks!
The text was updated successfully, but these errors were encountered: