curl: (60) SSL certificate problem: unable to get local issuer certificate
#wsl #brew #apt
結論を先に載せると、
brewで入れたcurl(/home/linuxbrew/.linuxbrew/bin/curl)がaptで入れたcurl(/usr/bin/curl)より優先されてたのが原因
brew unlink curlするかPATHの順番を調整することで解消可能
$fish_user_pathsより$PATHを優先させる
https接続をすると
code:log
$ curl https://github.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
って出る
調べると-k(--insecure)を付ける記事が大量に出てくるが求めてるのはそれじゃない
/etc/ssl/certs/ca-certificate.crtを置くといいよみたいな記事を見つけたけど既にあるが、、?ってなって初めてbrewを疑って気づいた
curlによるhttps通信 | Armadillo
brewでcurlを直接入れた記憶はないが、swiftがcurlに依存してるからcurlも勝手に入って今回の状況の状況になった
code:sh
$ brew uses --installed curl
swift
Macだとbrewでパッケージをインストールすると/usr/bin/XXXに入るためデフォルトのcurl(/usr/bin/curl)を参照できるが、Linuxだと依存パッケージも/home/linuxbrew/.linuxbrew/bin/XXXに存在する必要がある