Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't connect to production Apple Push Notification server

We had no problem sending notifications to provisioned devices using the development certification and gateway.sandbox.push.apple.com. But now now that our app is in the store, it appears we can't even connect to the production apn server (gateway.push.apple.com) to send pushes, even when we're using the machines that created the certificates in the first place.

We've run this through PushMeBaby and it looks like the connection to gateway.push.apple.com is getting refused. When it executes the handshake ( SSLHandshake(context) ) the result is error code -9044, or errSSLConnectionRefused - The peer dropped the connection before responding.

I know enough about ssl and encryption to know that I don't know a thing, but I'm pretty sure that the issue is (or starts with) our production SSL cert. Push notification is enabled for production in the iPhone portal (we have a green light). The certificate has been installed on the machine running PushMeBaby and I see both the certificate and the signing key in my keychain. When I exported the development push certificate and used it in PushMeBaby, I was able to connect (and send pushes) no problem. But with the production cert, We get nowhere. We've repeatedly revoked and recreated both the dev cert and the prod cert on two separate computers, so if this is human error, we're doing it repeatedly.

One thing that may be a factor is that I have the "team agent" key on my keychain, but I'm not her. I can and have submitted binaries to the App store without any issue.

Also, we've not set up a provisioning profile after creating the production cert. I'm not sure if that's a factor, but I can't see how it might be for an in-store app.

I sure hope someone has some ideas, because I'm out of them!

like image 408
Andrew Avatar asked Nov 30 '22 11:11

Andrew


1 Answers

As the documentation said it exists 2 certificates and 2 IP address for the push notification:

  • Sandbox: gateway.sandbox.push.apple.com, port 2195. (for the development)
  • Production: gateway.push.apple.com, port 2195. (for the release)

You always use the gateway for the development. Try to use the other gateway (for the production).

For more information see here: Provisioning and Development

like image 153
Yannick Loriot Avatar answered Dec 05 '22 20:12

Yannick Loriot