ssl-certificate - 签署 .mobileconfig 配置文件后,它显示为 "Unverified"- "The ceritifcate was signed by an unknown authority"

标签 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 之外,我是否可以使用任何工具来签署个人资料?

最佳答案

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

  • 从 key 链中导出证书

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

    例如:InnovCertificates.p12 到 InnovCertificates.pem
  • 下载苹果根证书和苹果中间证书

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

    下载文件是证书和 key 的组合。 (在终端命令中读取证书如下链接 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.
    
  • 签署并验证 .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 文件经过签名和验证。

  • 使用完整链接:
  • renren.io/questions/637349/ios-mobileconfig-walkarounds
  • developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/smime.1ssl.html#//apple_ref/doc/man/1/smime
  • www.apple.com/certificateauthority/
  • www.rootmanager.com/iphone-ota-configuration/iphone-ota-setup-with-signed-mobileconfig.html
  • info.ssl.com/article.aspx?id=12149
  • www.sslshopper.com/ssl-converter.html
  • wiki.cac.washington.edu/display/infra/Extracting+Certificate+and+Private+Key+Files+from+a+.pfx+File
  • stackoverflow.com/questions/9277426/ios-mobileconfig-walkarounds
  • stackoverflow.com/questions/991758/how-to-get-an-openssl-pem-file-from-key-and-crt-files
  • discussions.apple.com/thread/2363234
  • 关于ssl-certificate - 签署 .mobileconfig 配置文件后,它显示为 "Unverified"- "The ceritifcate was signed by an unknown authority",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17138856/

    相关文章:

    ios - iPad2 上的 Unity3d 应用程序需要旧版本。要运行的配置文件

    openssl - FreeIPA 外部 CA(中间 CA)

    c# - XCode 无法创建配置文件,ARKit

    ios - Xamarin IOS-缺少推送通知权利

    java - 生成自签名 ssl 证书作为 Maven 构建的一部分

    ios - 自动签名无法解决 "projectName"目标的权利文件的问题

    ios - 应用程序 ID 和捆绑标识符 : provisioning profile issues

    openssl - 如何仅更改现有 csr 中的主题 (CN)

    java - 在 SSL 握手中接受任何客户端证书

    curl - 错误 : The certificate of `raw.githubusercontent.com' is not trusted