无法连接Apple推送通知网关

时间:2011-04-30 10:31:22

标签: php apple-push-notifications

我用telnet测试了我的服务器,看起来工作正常:

telnet gateway.sandbox.push.apple.com 2195
Trying 17.149.34.142...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.

但我尝试在PHP-APNS中运行sample_push.php文件,但它在下面显示错误:

Sat, 30 Apr 2011 18:21:13 +0800 ApnsPHP[14447]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Sat, 30 Apr 2011 18:21:13 +0800 ApnsPHP[14447]: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195':  (0)
Sat, 30 Apr 2011 18:21:13 +0800 ApnsPHP[14447]: INFO: Retry to connect (1/3)...
Sat, 30 Apr 2011 18:21:14 +0800 ApnsPHP[14447]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Sat, 30 Apr 2011 18:21:14 +0800 ApnsPHP[14447]: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195':  (0)
Sat, 30 Apr 2011 18:21:14 +0800 ApnsPHP[14447]: INFO: Retry to connect (2/3)...
Sat, 30 Apr 2011 18:21:15 +0800 ApnsPHP[14447]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Sat, 30 Apr 2011 18:21:15 +0800 ApnsPHP[14447]: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195':  (0)
Sat, 30 Apr 2011 18:21:15 +0800 ApnsPHP[14447]: INFO: Retry to connect (3/3)...
Sat, 30 Apr 2011 18:21:16 +0800 ApnsPHP[14447]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...

Fatal error: Uncaught exception 'ApnsPHP_Exception' with message 'Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195'.................

任何想法?

1 个答案:

答案 0 :(得分:0)

据我所知,如果您提供错误的证书,Apple将断开您的TLS连接。

因此您可以远程登录APNS端口,但无法连接。