无法连接到“ssl://gateway.sandbox.push.apple.com:2195" [英] Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195'
问题描述
我在我的 macbook air 中成功运行了 APNS 代码,但结果我无法在我的另一台计算机上运行它:
I sucessfully run the APNS code in my macbook air, but it turns out that I can not run it in my other computer:
我检查过这些是一样的:1. .pem 文件(具体)2.程序
I checked that these are the same: 1. .pem file ( to be specific ) 2. Program
不能工作的电脑是:
Windows 7,XAMPP,支持OpenSSL,无防火墙
和
已打开 2195 和 2196 的 EC2 Linux 服务器
可能是什么其他问题导致我的 php 代码出现此错误?
What might be other issues causing that I got this error in my php code?
Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195'
我知道可能是没有打开 SSL 的原因,但我检查了 phpInfo(),它应该是正确的.
I know there might be cause by not opening SSL, but I checked the phpInfo(), it should be correct.
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.0.1c 10 May 2012
OpenSSL Header Version OpenSSL 0.9.8x
我在 EC2 服务器上尝试了 telnet,它给出了:
I tried telnet in EC2 server, it gives:
telnet gateway.push.apple.com 2195
Trying 17.149.36.239...
Connected to gateway.push-apple.com.akadns.net.
Escape character is '^]'.
推荐答案
感谢您的帮助,目前我已经解决了这个问题.
Thanks for help, so far I solved the solution.
问题是我对我的证书和根证书使用了相同的 pem 文件.
The problem is that I used the same pem file for both my cert and the root cert.
有一个根证书与我自己的证书不同,在连接过程中,两个证书都被使用,所以我必须获得苹果推送通知的根证书.
There is a root cert that is different from my own cert, during connection, both cert is used so I have to get the root cert of apple push notification.
谢谢!
这篇关于无法连接到“ssl://gateway.sandbox.push.apple.com:2195"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!