我正在尝试使用 Powershell 为 IIS 应用程序生成 CA 和 SSL 证书。当我手动将 CA 添加到本地计算机证书根存储时,它在 Windows 上按预期工作。
问题是从智能手机连接,当我尝试安装时,iPhone 拒绝识别 CA。
这是 CA 脚本:
$ca_certificate = New-SelfSignedCertificate -CertStoreLocation cert:\CurrentUser\My -NotAfter (Get-Date).AddDays(820) -DnsName 'VMS Certificate Authority' -KeyusageProperty All `
-KeyUsage CertSign, CRLSign, DigitalSignature -FriendlyName 'My CA' -KeyAlgorithm RSA -KeyLength 2048
Export-Certificate -Cert "Cert:\CurrentUser\My\$($ca_certificate.Thumbprint)" -FilePath "$PSScriptRoot\root-authority-public.cer"
我可以在我的 iPhone 上安装配置文件,但在安装过程中我收到警告消息“无法验证“我的 CA”的真实性”,除此之外什么都没有。安装后状态仍然是“未验证”。 General->About->Certificate Trust Settings 下没有任何东西(只有信任商店/ Assets 版本)。
我设法创建了一个 openssl CA,它已成功添加到手机,但未被使用 SSL 证书的应用程序识别。
有没有人有这方面的经验?
最佳答案
我设法让它工作了。显然,iOS 不会将证书识别为 CA,除非它具有基本约束 Subject Type=CA。
-TextExtension @("2.5.29.19={text}cA=true&pathLength=2")
因此,对于有效期为 5 年的 CA 的完整命令可能是
$ca_certificate = New-SelfSignedCertificate -CertStoreLocation cert:\CurrentUser\My -DnsName 'My Awesome CA' -KeyusageProperty All `
-KeyUsage CertSign, CRLSign, DigitalSignature -FriendlyName 'My Awesome CA' -TextExtension @("2.5.29.19={text}cA=true&pathLength=2") -NotAfter (Get-Date).AddYears(5)
关于ios - Powershell New-SelfSignedCertificate CA 不适用于 iOS 14.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65251919/