解决 bunx 报错 invalid CA cert

用以下脚本导出一份系统的 CA 证书:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$store = Get-ChildItem Cert:\LocalMachine\Root
$out = "cafile.crt"

Remove-Item $out -ErrorAction SilentlyContinue

foreach ($cert in $store) {
$pem = @"
-----BEGIN CERTIFICATE-----
$([System.Convert]::ToBase64String($cert.RawData, 'InsertLineBreaks'))
-----END CERTIFICATE-----

"@
Add-Content -Path $out -Value $pem
}

然后在 $HOME\.bunfig.toml 配置:

1
2
[install]
cafile = "C:/cafile.crt"
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×