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

Alo*_*urg 5 ssl-certificate provisioning-profile

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

根据这一点,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)
Run Code Online (Sandbox Code Playgroud)

还尝试用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    
Run Code Online (Sandbox Code Playgroud)

仍然得到"未验证"通过尝试在我的Mac上打开mobileconfig文件深入挖掘,它显示"此证书由未知的权威机构签署"

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

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

小智 5

如何在苹果中签名和验证 .mobileconfig 文件

  1. 从钥匙链导出证书

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

    例如:InnovCertificates.p12 到 InnovCertificates.pem

  2. 下载苹果根证书和苹果中级证书

    (对于我的 .mobileconfig 文件验证,我使用了 Apple Inc. 根证书(Apple Root Certificate)和应用程序集成证书(Apple Intermediate Certificate)证书。您也可以使用这些证书或 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.
    
    Run Code Online (Sandbox Code Playgroud)
  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      
    
    Run Code Online (Sandbox Code Playgroud)

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

使用完整链接:

  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. Discussion.apple.com/thread/2363234


Alo*_*urg 4

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

从您的证书提供商处下载子证书(例如:Startssl)并只需通过cat server.crt ca-bundle.crt > server.crt)将它们添加到您的服务器证书中