ios - Powershell New-SelfSignedCertificate CA 不适用于 iOS 14.2

标签 ios iphone powershell ssl certificate

我正在尝试使用 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/

相关文章:

ios - UIWebView 没有加载新的 url

ios - 在 ABAddressBookSave 上获取 EXC_BAD_ACCESS

ios - 如何使用 Storyboard将两个不同的选项卡栏图标连接到同一个 View Controller ?

iphone - 我必须延长哪一个类?

powershell - PowerShell v3 中 Get-ChildItem 的 PathTooLong 错误,但不是 v2

ios - 如何从音频记录生成签名(类似于 Shazam)

iphone - appcelerator 钛 : nested push animation can result in corrupted navigation bar 中的错误

ios - 在没有动画的情况下关闭 View Controller 后立即显示 View Controller

powershell - 在PowerShell脚本中处理命令提示符错误

PowerShell 作业与启动进程