fiddler证书过期,执行Reset All Certificates 页面卡死解决方案

批量删除证书

在powershell 里面执行

复制代码
<#
彻底删除 Fiddler 证书(删完立刻查不到)
#>

$IssuerFilter = "DO_NOT_TRUST_FiddlerRoot"
$logPath = ".\CertClean-Ultimate.log"

# 所有证书库(关键:加上 LocalMachine)
$stores = @(
    "Cert:\CurrentUser\My",
    "Cert:\CurrentUser\Root",
    "Cert:\LocalMachine\My",
    "Cert:\LocalMachine\Root"
)

$now = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
Add-Content $logPath "`n============================================="
Add-Content $logPath "执行时间: $now"
Add-Content $logPath "颁发者: $IssuerFilter"
Add-Content $logPath "============================================="

function Log($msg) {
    Write-Host $msg
    Add-Content $logPath $msg
}

# 1. 关 Fiddler、浏览器
Log "`n[1/6] 关闭 Fiddler/浏览器..."
Get-Process fiddler,chrome,msedge,firefox -EA SilentlyContinue | Stop-Process -Force

# 2. 停 CryptSvc 清系统证书缓存(非常关键)
Log "`n[2/6] 停止 Cryptographic Services 清缓存..."
net stop cryptsvc 2>&1 | Out-Null

# 3. 删证书(全库、不碰私钥)
foreach ($store in $stores) {
    Log "`n扫描:$store"
    $certs = Get-ChildItem $store -Recurse -EA SilentlyContinue |
        Where-Object { $_.Issuer -match $IssuerFilter }

    if (-not $certs) {
        Log "→ 无匹配证书"
        continue
    }

    Log "→ 找到 $($certs.Count) 张,删除..."
    foreach ($cert in $certs) {
        Log "指纹: $($cert.Thumbprint)"
        try {
            Remove-Item $cert.PSPath -Force -EA Stop
            Log "✅ 已删除"
        } catch {
            Log "❌ 失败: $_"
        }
    }
}

# 4. 清 RSA 私钥残留
Log "`n[4/6] 清理 RSA 私钥目录..."
Remove-Item "$env:APPDATA\Microsoft\Crypto\RSA\*" -Force -Recurse -EA SilentlyContinue
Remove-Item "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\*" -Force -Recurse -EA SilentlyContinue

# 5. 重启 CryptSvc
Log "`n[5/6] 重启 Cryptographic Services..."
net start cryptsvc 2>&1 | Out-Null

# 6. 验证(全库查)
Log "`n[6/6] 验证残留..."
$allGood = $true
foreach ($store in $stores) {
    $check = Get-ChildItem $store -Recurse -EA SilentlyContinue |
        Where-Object { $_.Issuer -match $IssuerFilter }
    if ($check) {
        Log "❌ $store 残留 $($check.Count) 张"
        $allGood = $false
    }
}

if ($allGood) {
    Log "`n✅ 全部删除干净,查询不到!"
}

Log "`n============================================="
Log "完成!建议重启电脑。"
相关推荐
保持当下14 天前
分享一些程序员很棘手但是却又简单的工具
程序员·免费·js·工具
私人珍藏库14 天前
[Android] FX Player-安卓全格式播放器-比MX播放器好用
android·学习·工具·软件·多功能
cup1115 天前
[开源] Memory Checker:极致轻量的 Windows 托盘内存监测工具,告别内存焦虑
python·内存·工具·任务管理器·托盘
私人珍藏库16 天前
[Android] OldRoll复古胶片相机高级版-徕卡-哈苏-宝丽来等等
数码相机·智能手机·app·工具·软件·多功能
孟郎郎16 天前
2026 年 15 款 AI 视频生成工具推荐
人工智能·ai·工具·ai视频
私人珍藏库16 天前
[Android] 精图地球-高清卫星3D街景VR地图工具
智能手机·app·工具·软件·多功能
私人珍藏库16 天前
[Android] 视频下载鸟 v20.02 会员
android·人工智能·智能手机·app·工具·多功能
私人珍藏库16 天前
[Android] 三维山水全景地图-3D地形全景观测地图
android·3d·app·工具·软件·多功能
什仙17 天前
Mathcad Prime 的教程资料
学习·工具
私人珍藏库17 天前
【Android】BotHub-多模型AI机器人聚合库-内置免费模型
android·人工智能·智能手机·app·工具·多功能