首页 > 解决方案 > openssl pkcs12 -export 向我返回错误,因为无法加载证书

问题描述

到目前为止,我曾经按照以下步骤创建用于推送的 p12 文件。

openssl x509 -in aps_development.cer -inform DER -out aps_development_identity.pem -outform PEM}
openssl pkcs12 -nocerts -out private_development_key.pem -in Certificates.p12
openssl rsa -out private_key_noenc.pem -in private_development_key.pem
openssl pkcs12 -export -in aps_development_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest.certSigningRequest -name "aps_development_identity" -out aps_development_identity.p12

注意:我的文件夹中已经有aps_development.cer, 。Certificates.p12CertificateSigningRequest.certSigningRequest

但是今天我在终端执行最后一条语句时出错。

执行最后一句话后,我得到如下错误。

openssl pkcs12 -export -in aps_development_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest.certSigningRequest -name "aps_development_identity" -out aps_development_identity.p12

unable to load certificates --> this is what I get in response

直到现在我还没有收到这样的错误。

知道我错过了什么。

我将 Swift 标记为 iOS 开发人员可能遇到过这个问题。所以我只是添加了 Swift 标签来将它们带入这个问题。


我只是认为这是因为我更新了 Ruby for pods。

Ruby 中有任何针对此导出的更新吗?

标签: swiftrubypush-notificationopensslapple-push-notifications

解决方案


最后我找到了解决方案。

openssl pkcs12 -export -in aps_development_identity.pem -inkey private_key_noenc.pem -name "aps_development_identity" -out aps_development_identity.p12

只需-certfile CertificateSigningRequest.certSigningRequest从最后一条语句中删除即可。


推荐阅读