views:

638

answers:

2

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!

A: 

Hi, 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

Yannick L.
Thanks for the reply. We are using gateway.push.apple.com only with the production cert -- this is where the connection is getting stopped. When we use gateway.sandbox.push.apple.com with the development cert, it works fine. We've been very careful not to mix the two.
Andrew
A: 

Yes, I've solved this error. I lost a few days finding the solution. The problem is in the line: result = SSLSetPeerDomainName(context, "gateway.sandbox.push.apple.com", 30); NSLog(@"SSLSetPeerDomainName(): %d", result);

You have to change the port to number 30. This solves the problem.

I hope you can resolve the issue.

Regards!

Marcelo