Apple 推送通知错误/SSL 错误 20
我在尝试使用 Apple 推送通知服务验证 SSL 证书时遇到问题。我按照 iOS 开发人员网站上的所有说明进行操作(创建新的配置文件、创建新的应用程序 ID、创建证书签名请求、下载 apns .cer 文件等)。
然后,按照在线教程,我将 .p12 文件转换为 .pem 文件,将 .cer 文件转换为 .pem 文件,以便尝试验证证书。
这是我在终端中发送的请求:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert MyCert.pem -key MyKey.pem
它询问我的密码,我给了它,它接受了。然后它返回了很多内容,最后带有以下简介:
验证返回代码:20(无法获取本地颁发者证书)
我在网上进行了广泛搜索,发现了一些似乎相关的内容,但是这些都没有帮助我。我也尝试重新启动整个过程,最终得到了相同的结果。
非常感谢任何帮助。
I'm having an issue when trying to verify my SSL certificate with Apple Push Notification Services. I followed all the instructions on the iOS developer site (creating the new provisioning profile, creating the new App ID, creating the certificate signing request, downloading the apns .cer file, etc).
Then, following a tutorial online, I converted my .p12 file into a .pem file, and my .cer file to a .pem file, in order to try to verify the certificates.
Here is the request I sent in the terminal:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert MyCert.pem -key MyKey.pem
It asked for my passphrase, which I gave it and it accepted. It then returned a lot of stuff with the following blurb at the end:
Verify return code: 20 (unable to get local issuer certificate)
I searched extensively online, and found a few things that seemed relevant, but none of which helped me. I also tried restarting the whole process, and ended up with the same result.
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是由于命令
openssl s_client -connect gateway.sandbox.push.apple.com:2195 中的空间所致
-cert PushChatCert.pem -key PushChatKey.pem
改为使用
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem
有趣但真实且令人尴尬,当您只是从站点命令..
It is due to space you have in your command
openssl s_client -connect gateway.sandbox.push.apple.com:2195
-cert PushChatCert.pem -key PushChatKey.pem
instead use
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem
Funny but true and embarassing when you just copy and paste from the site the command..
您似乎不信任颁发 APNS 证书的根证书。
要与 APN 建立 TLS 会话,必须在提供商的服务器上安装 Entrust Secure CA 根证书。
查看本地和推送通知编程指南了解更多详细信息。
It looks like you didn't trust the root certificate issuing your APNS certificate.
To establish a TLS session with APNs, the Entrust Secure CA root certificate must be installed on the provider’s server.
Have a look at the Local and Push Notification Programming Guide for more details.