Why can't I connect to apple push notification service?

It's my understanding that GoDaddy prohibits outgoing connections on exotic ports (anything other than 80 a perhaps a few others). You're probably out of luck trying to roll your own push service hosted on GoDaddy. I have had luck doing what you're attempting with bluehost.

Up vote 0 down vote favorite share g+ share fb share tw.

Dear All, I have meet a big problem when I was doing deleveloping about Apple Push Notification Service. I wrote a PHP script(apns. Php) which will use a PEM(ck.

Pem) file as security certicate and build a SSL connection to APNS when I post a HTTP request to it, but it always failed when it tryed to connect the service port ( sl://gateway.sandbox.push.apple. Com:2195) . The PHP script is deployed on a Linux Hosting of GoDaddy (it should support SSL).

I have already registered to be a member of iOS developer program,and I have registered the apple push notification service for my application. And I have generate a certificate file and a key file (cert. P12 and key.

P12)from Keychain Access and translate them into PEM files(cert. Pem and key. Pem) and join them into one(ck.

Pem) and put it in the same directory of PHP script . I want to know if there is something wrong I did! Would you refer to the attachment of the files that you may need?

Thanks very much! The HTTP request is something like below. http://www.insidertracker.net/apns/apns.php?message=&badge=2&sound=received5.caf the response message of my request is below: Warning: stream_socket_client() function.

Stream-socket-client: unable to connect to ssl://gateway.sandbox.push.apple. Com:2195 (Connection refused) in /home/content/40/6967940/html/apns/apns. Php on line 25 Failed to connect 111 Connection refused the PHP script: $message); if ($badge) $body'aps''badge' = $badge; if ($sound) $body'aps''sound' = $sound; /* End of Configurable Items */ $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.

Pem'); // assume the private key passphase was removed. Stream_context_set_option($ctx, 'ssl', 'passphrase', $pass); // connect to apns $fp = stream_socket_client('ssl://gateway.sandbox.push.apple. Com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx); // $fp = fsockopen('ssl://gateway.sandbox.push.apple.

Com:2195', 2195, $err, $errstr, 30); if (!$fp) { print "Failed to connect $err $errstr\n"; return; } else { print "Connection OK\n"; } // send message $payload = json_encode($body); $msg = chr(0) . Pack("n",32) . Pack('H*', str_replace(' ', '', $deviceToken)) .

Pack ("n",strlen($payload)) . $payload; print "Sending message :" . $payload .

"\n"; fwrite($fp, $msg); fclose($fp);? > iphone ssl push-notification apns link|improve this question asked Nov 25 '10 at 15:07finger11.

It's my understanding that GoDaddy prohibits outgoing connections on exotic ports (anything other than 80 a perhaps a few others). You're probably out of luck trying to roll your own push service hosted on GoDaddy. I have had luck doing what you're attempting with bluehost.

For general advice on developing a push service in PHP, these two articles were invaluable: One Two.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions