无法连接到生产Apple推送通知服务器

无法连接到生产Apple推送通知服务器

问题描述:

使用开发认证和gateway.sandbox.push.apple.com向配置的设备发送通知没有问题。但现在我们的应用程序已经在商店中,看起来我们甚至无法连接到生产apn服务器(gateway.push.apple.com)来发送推送,即使我们正在使用创建证书的机器第一个地方。

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.

我们通过PushMeBaby运行它,看起来与gateway.push.apple.com的连接被拒绝了。当它执行握手(SSLHandshake(context))时,结果是错误代码-9044,或者errSSLConnectionRefused - 对等体在响应之前删除了连接。

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.

我对ssl和加密知识得足以知道我不知道什么,但我很确定问题是(或者从我们的生产开始) SSL证书。推送通知已启用iPhone门户中的生产(我们有一个绿灯)。证书已安装在运行PushMeBaby的计算机上,我在钥匙串中看到证书和签名密钥。当我导出开发推送证书并在PushMeBaby中使用它时,我能够连接(和发送推送)没问题。但凭借生产证书,我们无处可去。我们在两*立的计算机上反复撤销并重新创建了dev证书和prod证书,所以如果这是人为错误,我们会反复进行。

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.

一可能是一个因素的事情是我的钥匙串上有团队代理钥匙,但我不是她。我可以并且已经将二进制文件提交到App商店而没有任何问题。

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!

是的,我已经解决了这个错误。
我失去了几天找到解决方案。

Yes, I've solved this error. I lost a few days finding the solution.

问题在于:

result = SSLSetPeerDomainName(context, "gateway.sandbox.push.apple.com", 30); 

NSLog(@"SSLSetPeerDomainName(): %d", result);

您必须将端口更改为数字30.这样才能解决问题。

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