【问题标题】:APNS : openssl s_client gethostbyname failureAPNS:openssl s_client gethostbyname 失败
【发布时间】:2013-08-22 07:12:12
【问题描述】:

我正在尝试使用以下命令测试我的服务器与 Apple 的沙盒 APNS 服务器之间的连接:

$ openssl s_client -connect gateway.sandbox.apple.com:2195 -cert cert.pem -key key.pem
Enter pass phrase for key.pem:
gethostbyname failure
connect:errno=0

gethostbyname failure是什么意思,是什么原因?

在同一台服务器上,telnet 到 2195 端口工作正常:

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

更新:如果我使用 IP 而不是主机名,它可以正常工作:

$ openssl s_client -connect 17.149.36.242:2195 -cert cert.pem -key key.pem

OpenSSL 无法解析 DNS ?

【问题讨论】:

    标签: ios openssl push-notification apple-push-notifications


    【解决方案1】:

    沙盒的正确名称是 gateway.sandbox.push.apple.com,而不是 gateway.sandbox.apple.com。

    【讨论】:

    • 嗨 Eran,我使用了 openssl s_client –connect gateway.sandbox.push.apple.com:2195 -cert my_cert.pem -key my_cert.pem 但我也遇到了同样的错误 gethostbyname failure connect :errno=0 .. 我也是新的 iOS 和推送通知.. 请提供有用的链接或代码 sn-ps :)
    猜你喜欢
    • 2017-01-16
    • 2014-05-31
    • 1970-01-01
    • 2017-09-18
    • 1970-01-01
    • 2019-07-20
    • 1970-01-01
    • 2011-07-13
    • 2015-05-20
    相关资源
    最近更新 更多