token in sample_push.php

228 views
Skip to first unread message

Pahup

unread,
Dec 1, 2011, 4:38:33 AM12/1/11
to apns-php
I am trying to setup my own server(Provider) which helps me send
notifications.

I copied the apns-php on xampp htdocs.
Placed server_cerificates_bundle_sandbox.pem file near to
sample_push.php, made sure the name is correct in php file.
I also placed entrust .pem file.
I have created an iOS application,which connects to urbanairship and
brings me a token.
I am using that token in following line as parameter.
$message = new ApnsPHP_Message(');


When I launch sample_push.php from browser, I get following


Thu, 01 Dec 2011 09:30:04 +0000 ApnsPHP[16958]: INFO: Trying
ssl://gateway.sandbox.push.apple.com:2195... Thu, 01 Dec 2011 09:30:04
+0000 ApnsPHP[16958]: ERROR: Unable to connect to 'ssl://
gateway.sandbox.push.apple.com:2195': (0) Thu, 01 Dec 2011 09:30:04
+0000 ApnsPHP[16958]: INFO: Retry to connect (1/3)... Thu, 01 Dec 2011
09:30:05 +0000 ApnsPHP[16958]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Thu, 01 Dec 2011 09:30:06 +0000 ApnsPHP[16958]: ERROR: Unable to
connect to 'ssl://gateway.sandbox.push.apple.com:2195': (0) Thu, 01
Dec 2011 09:30:06 +0000 ApnsPHP[16958]: INFO: Retry to connect
(2/3)... Thu, 01 Dec 2011 09:30:07 +0000 ApnsPHP[16958]: INFO: Trying
ssl://gateway.sandbox.push.apple.com:2195... Thu, 01 Dec 2011 09:30:08
+0000 ApnsPHP[16958]: ERROR: Unable to connect to 'ssl://
gateway.sandbox.push.apple.com:2195': (0) Thu, 01 Dec 2011 09:30:08
+0000 ApnsPHP[16958]: INFO: Retry to connect (3/3)... Thu, 01 Dec 2011
09:30:09 +0000 ApnsPHP[16958]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Fatal error: Uncaught exception 'ApnsPHP_Exception' with message
'Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195':
(0)' in /Applications/XAMPP/xamppfiles/htdocs/iOSNotification/ApnsPHP/
Abstract.php:352 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/
iOSNotification/ApnsPHP/Abstract.php(295): ApnsPHP_Abstract-
>_connect() #1 /Applications/XAMPP/xamppfiles/htdocs/iOSNotification/
sample_push.php(42): ApnsPHP_Abstract->connect() #2 {main} thrown in /
Applications/XAMPP/xamppfiles/htdocs/iOSNotification/ApnsPHP/
Abstract.php on line 352


I've checked that I am able to telnet on my teminal to apple sandbox
apns on 2195 port.
I also checked that, xampp has openssl enabled.

What am I doing wrong, any help is much appreciated.

-Pahup

vince

unread,
Dec 12, 2011, 5:10:11 AM12/12/11
to apns-php
I have the same problem, have you found a way to solve?

Pahup Bilala

unread,
Dec 12, 2011, 5:26:29 AM12/12/11
to apns...@googlegroups.com
Private key for the .cer downloaded from my mac keychain.

-Pahup

Pahup Bilala

unread,
Dec 12, 2011, 5:27:41 AM12/12/11
to apns...@googlegroups.com
Private key for the .cer downloaded was missing from my mac keychain.
Actually I took .cer file from my peer, and forgot to take the private key from his keychain.


-Pahup
Reply all
Reply to author
Forward
0 new messages