Ios 使用telnet时外部主机关闭的连接

Ios 使用telnet时外部主机关闭的连接,ios,xcode,apple-push-notifications,Ios,Xcode,Apple Push Notifications,我第一次开发推送通知时遇到了这个telnet命令: telnet gateway.push.apple.com 2195 我使用此命令得到以下响应 Trying 17.172.233.151... Connected to gateway.push-apple.com.akadns.net. Escape character is '^]' 但大约30秒后,它显示为“连接被外部主机关闭”,因此我不知道我的服务器是否连接到Apple推送通知服务器 任何帮助都将不胜感激,谢谢 看看这个。获得必要的

我第一次开发推送通知时遇到了这个telnet命令:

telnet gateway.push.apple.com 2195

我使用此命令得到以下响应

Trying 17.172.233.151...
Connected to gateway.push-apple.com.akadns.net.
Escape character is '^]'
但大约30秒后,它显示为“连接被外部主机关闭”,因此我不知道我的服务器是否连接到Apple推送通知服务器

任何帮助都将不胜感激,谢谢

看看这个。获得必要的证书后,使用此测试是否可以成功连接到APN:

openssl s_client-connect gateway.sandbox.push.apple.com:2195-cert-PushChatCert.pem-key-PushChatKey.pem

注意:如果您遇到类似
错误:num=20:无法获取本地颁发者证书之类的错误,只需下载,然后与其他证书一起,您可以这样检查:


openssl s_client-connect gateway.sandbox.push.apple.com:2195-cert-PushChatCert.pem-key-PushChatKey.pem-CAfile-trust\u 2048\u ca.cer

您是否检查了您的
端口2195
是否被防火墙阻止?服务器中是否启用了2195和2196端口?Windows还是Linux?我在windows和linux中都检查了
gateway.push.apple.com 2195
,它可以工作。在
gateway.sandbox.push.apple.com 2195
中也会出现这种情况吗?它是linux,是的,在sandbox中得到同样的东西。