Windows 11下Localhost证书导入TRCA后立即消失问题求助
Windows 11下ASP.NET自签名开发证书导入TRCA后自动消失问题
在Windows 11系统上开发ASP.NET应用时,测试所需的自签名开发证书始终无法保留在**Trusted Root Certification Authorities(TRCA)**文件夹中——刚导入后快速刷新能看到该证书,但1-2秒后就会消失。
已尝试的操作
- 以管理员/普通用户身份执行
dotnet dev-certs相关命令(命令日志见下文) - 通过certmgr复制粘贴证书,使用
certutil、netsh、makecert及New-SelfSignedCertificate等工具手动创建、导出并导入证书 - 删除
Roaming/ASP.NET/https、Local/ASP.NET/DataProtection-Keys文件夹及所有机密文件 - 修复、卸载重装IIS Express,多次卸载重装修复不同版本的Visual Studio与VS Code
命令行操作日志
C:\Windows\System32>dotnet dev-certs https --clean Cleaning HTTPS development certificates from the machine. A prompt might get displayed to confirm the removal of some of the certificates. HTTPS development certificates successfully removed from the machine. C:\Windows\System32>dotnet dev-certs https The HTTPS developer certificate was generated successfully. C:\Windows\System32>dotnet dev-certs https --trust Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate. Successfully trusted the existing HTTPS certificate. C:\Windows\System32>dotnet dev-certs https --check --trust The following certificates were found, but none of them is trusted: 1 certificate 1) 8AC3C820AF03BC63F05179ED5762728BB38F171A - CN=localhost - Valid from 2024-06-04 13:19:17Z to 2025-06-04 13:19:17Z - IsHttpsDevelopmentCertificate: true - IsExportable: true
疑问
该电脑已加入Active Directory,是否可能是**组策略(GPO)**导致证书被自动删除?
安全组策略汇总
内容的提问来源于stack exchange,提问作者Thor
相关产品推荐
相关产品推荐

