【问题标题】:After signing .mobileconfig profile it shows as "Unverified" - "The ceritifcate was signed by an unknown authority"签署 .mobileconfig 配置文件后,它显示为“未验证”-“证书由未知机构签署”
【发布时间】:2020-08-14 22:49:52
【问题描述】:

我正在尝试使用由 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 之外,我还有什么可以用来签署个人资料的工具可以提供更多洞察力吗?

【问题讨论】:

    标签: ssl-certificate provisioning-profile


    【解决方案1】:

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

    1. 从密钥链中导出证书

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

      例如:InnovCertificates.p12 到 InnovCertificates.pem

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

      (对于我的 .mobileconfig 文件验证,我使用了 Apple Inc. 根证书(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 文件经过签名和验证。

    使用完整链接:

    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

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 2017-01-03
        • 2012-11-29
        • 2012-10-31
        • 2017-12-23
        • 2018-06-04
        • 2020-05-27
        • 2019-10-29
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多