如果要在 iis 中创建自签名证书,可以尝试以下方式之一:
1)使用图形用户界面
- 打开 iis 管理器
- 单击左侧 Connections 列中的服务器名称,然后双击 Server Certificates



- 单击确定。完成后,您现在应该在自签名证书列表中看到 SSL。
2)使用命令提示符
New-SelfSignedCertificate -DnsName www.domain.com -CertStoreLocation cert:Localmachine\My
您还可以尝试按照以下步骤将证书移动到受信任的根目录:
1)以管理员身份打开 mmc.exe。
2) 在 MMC 控制台的顶部菜单中,单击文件 > 添加/删除管理单元...。

3) 在“添加或删除管理单元”窗口的“可用管理单元:”部分中,选择“证书”,然后单击“添加 >”。

4) 在证书管理单元窗口中,选择计算机帐户,然后单击下一步。

5) 在“添加或删除管理单元”窗口中,您现在应该看到“证书(本地计算机)”管理单元。

6)点击确定
7) 在 MMC 控制台的控制台树中,展开证书(本地计算机)> 个人,然后选择证书文件夹。

8) 在中心窗格中,选择要移动的证书。
9)右键单击证书,然后单击复制。

10)现在展开信任根证书颁发机构,证书文件夹。

11)右键单击中间窗格并粘贴证书。
如果您已经拥有证书,则可以通过以下文章将其导入并设置在受信任的根存储中:
如何信任 IIS Express 自签名证书