【问题标题】:Error In Push Notification on Distribution分发推送通知中的错误
【发布时间】:2016-10-15 09:07:46
【问题描述】:

我在开发端创建 ck.pem 文件后实现了推送通知。但是当我在分发端创建时,我们检查 ck.pem 文件是否正确。我有错误显示如下:-

pksinghs-Mac-mini:SchoolPush pksingh$ php /Users/pksingh/Desktop/SchoolPush/simplepush.php

警告:stream_socket_client():SSL 操作失败,代码为 1。OpenSSL 错误消息: 错误:14094416:SSL 例程:SSL3_READ_BYTES:sslv3 警报证书在第 21 行的 /Users/pksingh/Desktop/SchoolPush/simplepush.php 中未知

警告:stream_socket_client():无法在第 21 行的 /Users/pksingh/Desktop/SchoolPush/simplepush.php 中启用加密

警告:stream_socket_client():无法连接到第 21 行 /Users/pksingh/Desktop/SchoolPush/simplepush.php 中的 ssl://gateway.push.apple.com:2195(未知错误) 连接失败:0 pksinghs-Mac-mini:SchoolPush pksingh$

我在桌面上的同一文件夹中有 ck.pem 文件和 pushnofication.php。 谁能帮帮我。

【问题讨论】:

    标签: ios iphone


    【解决方案1】:

    从下面的链接中找到如何创建证书和实现通知的教程

    https://www.raywenderlich.com/123862/push-notifications-tutorial

    您可以使用以下命令创建证书

    所以创建分发证书有问题

    使用以下命令创建证书

    openssl x509 -in aps_production.cer -inform der -out PushChatCert.pem

    openssl pkcs12 -nocerts -out PushChatKey.pem -in Certificates_dist.p12

    猫 PushChatCert.pem PushChatKey.pem > ck_dist.pem

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

    在哪里

    aps_production.cer = 从开发者苹果下载

    Certificates_dist.p12 = 安装 aps_production.cer 后从您的钥匙串中导出

    【讨论】:

    • 其实我已经实现了开发推送通知。它工作完美。但现在我想在分发端实现。所以我有错误。
    • 实际上我已将证书名称保存为 cert.pem 并将密钥名称保存为 key.p12
    • 您从 developer.apple 下载的证书名称是什么?
    • ios_distribution.cer
    • 然后只需将 aps_production.cer 替换为 ios_distribution.cer 并将 Certificates_dist.p12 替换为 key.p12
    猜你喜欢
    • 2014-03-27
    • 1970-01-01
    • 1970-01-01
    • 2012-12-23
    • 2018-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多