签署.mobileconfig配置文件后,它显示为“未验证” - “ceritifcate由未知权限签署”

时间:2013-06-16 23:57:51

标签: ssl-certificate provisioning-profile

我正在尝试使用networksolutions.com发布的SSL证书签署配置文件(CardDav)

根据this

,NetworkSolutions.com应该是iOS / OSX可信赖的提供商之一

我还看到NetworkSolutions签署的其他配置文件已经“验证”就好了。

这是我用来签署个人资料的Ruby代码

ssl_key_str = File.read(Rails.root.join("config/ssl/server.key"))
ssl_key = OpenSSL::PKey::RSA.new(ssl_key_str)
ssl_cert_str = File.read(Rails.root.join("config/ssl/server.crt"))
ssl_cert = OpenSSL::X509::Certificate.new(ssl_cert_str)
signed_profile = OpenSSL::PKCS7.sign(ssl_cert, ssl_key, profile, [], OpenSSL::PKCS7::BINARY)

还试图用openssl签名:

openssl smime -sign -in apple_sync_profile-unsigned.mobileconfig -out signed.mobileconfig -signer server.crt -inkey server.key -certfile server.crt -outform der -nodetach    

仍然“未经验证” 通过尝试在我的Mac上打开mobileconfig文件深入挖掘,它显示“此证书由未知权限签署”

我尝试与我下载的其他个人资料进行比较,并显示为已验证,但无法提出任何有意义的差异。

有什么建议吗? 我是否可以使用任何工具来签署除openssl之外的配置文件,这可能能够提供更多的洞察力?

2 个答案:

答案 0 :(得分:4)

如何在apple中签名并验证.mobileconfig文件

  1. 从钥匙链中导出证书

    钥匙串访问 - >荣誉证书(LeftPanel) - >右键单击特定证书并导出证书。 将.p12文件转换为PEM文件(转换使用此链接www.sslshopper.com/ssl-converter.html)

    例如:InnovCertificates.p12到InnovCertificates.pem

  2. 下载Apple Root证书和Apple中级证书

    (对于我的.mobileconfig文件验证,我使用Apple Inc.根证书(Apple Root Certificate)和  应用程序集成证书(Apple中级证书)证书。 您还可以使用这些证书或Apple证书中的其他证书www.apple.com/certificateauthority /)

    下载文件是证书和密钥的组合。 (阅读终端命令中的证书如下链接info.ssl.com/article.aspx?id=12149) 从这个证书文件中我们需要提取证书。

    extract certificate from Apple Root Certificate. Then extract certificate from Apple Intermediate Certificate
    
    openssl x509 -inform DER -outform PEM -in AppleIncRootCertificate.cer -out root.crt.pem
    openssl x509 -inform DER -outform PEM -in AppleAAICA.cer -out Intermediate.crt.pem
    
    open the two extracted file in text editor,
    copy and paste the Intermediate.crt.pem to beginning of the root.crt.pem and save .then your root.crt.pem file is combination of two certificate.
    
  3. 签名并验证.mobileconfig文件

    Once you have all the files listed above, you will run a command like the following:
    
    openssl smime -sign -in Example.mobileconfig -out SignedVerifyExample.mobileconfig -signer InnovCertificates.pem -certfile root.crt.pem -outform der -nodetach      
    

    结果.mobileconfig文件已签名并经过验证。

  4. 使用完整链接:

    1. renren.io/questions/637349/ios-mobileconfig-walkarounds

    2. developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/smime.1ssl.html#//apple_ref/doc/man/1/smime

    3. www.apple.com/certificateauthority/

    4. www.rootmanager.com/iphone-ota-configuration/iphone-ota-setup-with-signed-mobileconfig.html

    5. info.ssl.com/article.aspx?id=12149

    6. www.sslshopper.com/ssl-converter.html

    7. wiki.cac.washington.edu/display/infra/Extracting+Certificate+and+Private+Key+Files+from+a+.pfx+File

    8. stackoverflow.com/questions/9277426/ios-mobileconfig-walkarounds

    9. stackoverflow.com/questions/991758/how-to-get-an-openssl-pem-file-from-key-and-crt-files

    10. discussions.apple.com/thread/2363234

答案 1 :(得分:3)

我的证书由子CA签名,但未包含完整的证书链。为了完成签名,您必须提供包含完整证书链的完整server.crt证书。

从证书提供商处下载子证书(例如:Startssl)并将其简单地添加到您的服务器证书中cat server.crt ca-bundle.crt > server.crt