为了账号安全,请及时绑定邮箱和手机立即绑定

连接到gateway.sandbox.push.apple.com时出现“验证错误:num =

/ 猿问

连接到gateway.sandbox.push.apple.com时出现“验证错误:num =

扬帆大鱼 2019-11-26 12:55:47

我正在尝试运行在iOS 6教程:第1/2部分的Apple Push Notification Services中找到的Ray Wenderlich教程。


我在本地目录中创建了AppID和SSL证书以及密钥和PEM文件。之后,我进入测试证书是否有效的步骤,并从此本地目录调用了以下命令:


$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 

-cert PushChatCert.pem -key PushChatKey.pem

这产生了很多输出。在输出的中间是以下内容:


verify error:num=20:unable to get local issuer certificate

verify return:0

这是错误,还是测试错误?如果是错误,将是什么原因或您将建议如何解决?


这是完整的输出(减去证书数据):


Enter pass phrase for PushChatKey.pem:    

CONNECTED(00000003)

depth=1 /C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C

verify error:num=20:unable to get local issuer certificate

verify return:0

---

Certificate chain

 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./OU=iTMS Engineering/CN=gateway.sandbox.push.apple.com

   i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C

 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C

   i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048)

---

Server certificate

-----BEGIN CERTIFICATE-----


<Long string of data removed>


-----END CERTIFICATE-----

subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./OU=iTMS Engineering/CN=gateway.sandbox.push.apple.com

issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C

---

No client certificate CA names sent

---

SSL handshake has read 2731 bytes and written 2215 bytes

---

New, TLSv1/SSLv3, Cipher is AES256-SHA

Server public key is 2048 bit

Secure Renegotiation IS supported

Compression: NONE

Expansion: NONE


该教程继续说:“如果连接成功,您应该可以输入几个字符。按Enter键时,服务器应该断开连接。” 我能够做到这一点,并且服务器已断开连接。


但是本教程继续说,您可能必须查看输出以发现错误。因此,这个问题的原因。


查看完整描述

2 回答

?
慕雪6442864

我只是完成了相同的教程,所以接受的答案可能不是您想要的。如果再次查看本教程,则应输入:


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

如果将其键入为一行,它将起作用:


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


查看完整回答
反对 回复 2019-11-26
  • 2 回答
  • 0 关注
  • 485 浏览
我要回答
慕课专栏
更多

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信