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 "完成!建议重启电脑。"
相关推荐
小当家.1059 小时前
Excel AI Converter:用 大模型 自动转换excel表格格式
人工智能·excel·工具
小贺儿开发21 小时前
Unity3D 图片循环查看器
unity·工具·图片·列表·循环·ugui·互动
cup112 天前
[开源] Meta Assistant / 告别命令行,我为一堆 Python 脚本做了一个 Windows 任务栏的“家”
windows·python·工具·nuitka·脚本运行
网络研究院2 天前
AgentGG:开源的代理式 SAST 扫描器
开源·github·工具·网络研究观·agentgg
SEO_juper2 天前
2026 谷歌 GEO 免费工具全解:从监测、检测到内容创作,一站式指南
大数据·工具·外贸·geo·独立站·跨境电商独立站·谷歌优化
私人珍藏库3 天前
【Android】 VidFetch一键下载各大平台视-内置播放器
android·app·工具·软件·多功能
私人珍藏库4 天前
【Android】Wallcraft 3.62.0-最强4 K壁纸软件-解锁高级版
android·智能手机·app·工具·软件·多功能
小贺儿开发5 天前
Unity VideoPlayer 播放控制器
unity·编辑器·播放器·视频·工具·videoplayer·互动
雾岛心情6 天前
【小铭邮件】小铭邮件管理工具箱之利用CSV同步日历
github·工具·邮件·小铭邮件工具箱·o365