首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >连接到gateway.sandbox.push.apple.com时“验证error:num=20”

连接到gateway.sandbox.push.apple.com时“验证error:num=20”
EN

Stack Overflow用户
提问于 2014-04-28 22:33:51
回答 1查看 82.1K关注 0票数 62

我正在尝试运行在Apple Push Notification Services in iOS 6 Tutorial: Part 1/2上找到的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
SSL-Session:
    Protocol  : TLSv1
    Cipher    : AES256-SHA
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: <removed>
    Key-Arg   : None
    Start Time: 1398633302
    Timeout   : 300 (sec)
    Verify return code: 0 (ok)
---

本教程接着说,“如果连接成功,您应该能够键入几个字符。当您按enter时,服务器应该断开连接。”我能够做到这一点,但服务器断开了连接。

但本教程接着说,您可能必须查看输出才能找到错误。因此,提出这个问题的原因。

EN

回答 1

Stack Overflow用户

发布于 2016-02-04 10:38:16

我只是做了同样的教程,被接受的答案可能不是你想要的。如果你再看一遍教程,你需要输入:

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
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23343910

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档