Apple推送通知,如何正确导出我的证书? [英] Apple Push Notifications, how do I properly export my cert?

查看:317
本文介绍了Apple推送通知,如何正确导出我的证书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法找出如何正确导出我的证书,在我的iOS应用程序使用推送通知。我使用的是从 iOS Provisioning Portal 证书部分下载的以下证书。





我在网络上找到的许多教程都是不同的,让我的证书成为 .pem 格式,用于

  • http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial /

  • http: //code.google.com/p/apns-sharp/wiki/HowToCreatePKCS12证书

  • http://wiki.cs.unh.edu/wiki/index.php/Using_the_Apple_Push_Notification_Service



  • 这些解决方案中没有一个工作。我在这里坐在这里看着下面的错误从控制台,当我尝试使用ruby-apns:

      sslv3警报证书未知(OpenSSL :: SSL :: SSLError)



    我这样做错了吗?



    =============================



    Overnight Courtesy Bump隐形编辑



    所以我昨晚打了我的头靠在墙上,实际上发现了苹果自己的指示。它几乎是一样的,我试着它相同的曲调。不过,这里是此链接

      openssl pkcs12 -in CertificateName。 p12 -out CertificateName.pem -nodes 


    解决方案

    首先,您需要设置应用程序ID的配置以启用推送通知服务。您可以检入图片。



    2)然后您可以在您的机器中的钥匙串中安装证书和intall。



    3)这里导出两个文件。而不是只需要导出私钥,如截图所示。



    4)现在你可以导出私钥和存储任何你想要的.p12格式,如下面的屏幕截图所示。



    5)然后按照你熟悉的所有其他步骤,如上所述。

      openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes 

    如果您还有任何问题或者您不能然后让我知道。


    I can't seem to figure out how to properly export my cert for use in my iOS app with push notifications. I'm using the following cert, downloaded from the Certificates section of the iOS Provisioning Portal.

    I'm then following one of the many tutorials I've found all over the web that are all different by the way, to get my cert into a .pem format for use in ruby-apns.

    First I export it from the Keychain:

    After I give it a name and a password I perform the following commands in the terminal*:

    openssl pkcs12 -in cert.p12 -out apple_push_notification_dev.pem -nodes -clcerts
    

    *note: this isn't the only way I've tried this, just the latest, I have also tried via the instructions at the following urls:

    Not a single one of these solutions work. I'm sitting here looking at the following error from the console when I try to use ruby-apns:

    read finished A: sslv3 alert certificate unknown (OpenSSL::SSL::SSLError)
    

    And essentially every other server solution I've found has told me my certificate is incorrect or that there's a problem with it as well.

    Am I doing this wrong?

    ===============================

    Overnight Courtesy Bump Stealth Edit

    So I beat my head against the wall last night, and actually came across Apple's own instructions for doing this. It's almost the exact same, and I tried it to the same tune. Nevertheless, here is the latest attempt from this link:

    openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes
    

    解决方案

    (1) First you need to set the configuration for your app ID to enable push notification service. You can check in the image.

    (2) Then You can install the certificate and intall in your keychain in your machine.

    (3) Here you are exporting two files. Instead of that you just need to export the private key as shown in the screenshot.

    (4) Now you can export the private key and store with any name you want in .p12 format as shown in the screenshot below.

    (5) Then follows all other steps as you know very well like you mentioned above.

    openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes
    

    Please let me know if you still have any question or if you are not able to solve then let me know.

    这篇关于Apple推送通知,如何正确导出我的证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆