连接苹果推送通知网关失败
我用 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'.................
有什么想法吗?
i tested my server with telnet, it seems like working fine:
telnet gateway.sandbox.push.apple.com 2195
Trying 17.149.34.142...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.
but i try to run sample_push.php file in PHP-APNS , but it show error below:
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'.................
any ideas ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,如果您提供了错误的证书,Apple 将断开您的 TLS 连接。
所以你可以telnet APNS端口,但无法连接。
As far as I know, if you provide a wrong certificate, Apple will disconnect your TLS connection.
So you can telnet the APNS port, but fail to connect.