无法连接到'ssl://gateway.sandbox.push.apple.com:2195'

Ric*_*han 8 php apache openssl apple-push-notifications

我在macbook air中成功运行了APNS代码,但事实证明我无法在其他计算机上运行它:

我检查了它们是一样的:1..pem文件(具体)2.程序

电脑无法正常工作:

Windows 7,XAMPP,支持OpenSSL,无防火墙

打开2195和2196的EC2 Linux服务器

可能是导致我在我的PHP代码中出现此错误的其他问题?

Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195'
Run Code Online (Sandbox Code Playgroud)

我知道可能有没有打开SSL的原因,但我检查了phpInfo(),它应该是正确的.

openssl 

OpenSSL support enabled 
OpenSSL Library Version OpenSSL 1.0.1c 10 May 2012 
OpenSSL Header Version  OpenSSL 0.9.8x
Run Code Online (Sandbox Code Playgroud)

我在EC2服务器上试过telnet,它给出:

telnet gateway.push.apple.com 2195
Trying 17.149.36.239...
Connected to gateway.push-apple.com.akadns.net.
Escape character is '^]'.
Run Code Online (Sandbox Code Playgroud)

Ric*_*han 1

感谢您的帮助,到目前为止我已经解决了解决方案。

问题是我的证书和根证书使用了相同的 pem 文件。

有一个根证书与我自己的证书不同,在连接过程中,使用了两个证书,所以我必须获取苹果推送通知的根证书。

谢谢!