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 "完成!建议重启电脑。"
相关推荐
w2845118831 天前
全站开发环境管理
工具
GitFun3 天前
电脑空间总不够?实测120张挖出2.58MB重复
开源·工具
狮子座的男孩6 天前
解决:使用Burp Suite工具实现防重放攻击的过程及遇到的代理等问题
经验分享·web开发·工具·代理·burpsuite·网络开发·防重放攻击
Liudef067 天前
用 DeepSeek Search API 做一个干净的单文件搜索页面(附完整源码)
前端·人工智能·工具·搜索·deepseek
for_ever_love__13 天前
检索工具化封装:把 Elasticsearch、SQL、Confluence 包装成 Agent 的统一工具
agent·工具·封装·调用·rag·检索·做成
for_ever_love__15 天前
RAGAS 实战:一套能跑起来的 RAG 自动评测框架
人工智能·框架·工具·自动·rag·评估·评测
熊猫钓鱼>_>15 天前
当工具成为类:Softmax困境与连接器过载的算法根源
算法·ai·agent·工具·曲线·华为云码道·生态图鉴
小贺儿开发24 天前
Unity 局域网遥控幻灯片展示工具 3.0
科技·http·unity·工具·ppt·通信·网页
小贺儿开发1 个月前
Unity 家居视频遥控(细节优化)
科技·unity·程序员·udp·视频·工具·通信
天若有情6731 个月前
独立开发复盘:我用 Node.js 做了个在线工具箱
前端·json·工具