報錯內容:
curl: (77) error setting certificate verify locations:
CAfile: /data/usr/local/anaconda/ssl/cacert.pem
CApath: none
報錯原因: cacert.pem
的尋址路徑 CAfile
不對,也就是在該路徑下找不到文件。
解決方法:
1、找到你的 cacert.pem
文件所在位置 /path/to/cacert.pem
。如果你沒有該證書,可以先在 https://curl.se/ca/cacert.pem 下載,保存在某個目錄中。
2、設置環(huán)境變量:
export CURL_CA_BUNDLE=/path/to/cacert.pem
將"/path/to/cacert.pem"替換為你的證書文件的實際路徑。
3、測試Curl:文章來源:http://www.zghlxwxcb.cn/news/detail-605452.html
curl https://www.google.com
用任意網址測試Curl是否能夠正常工作。如果設置成功,就能夠看到測試網頁的HTML代碼。文章來源地址http://www.zghlxwxcb.cn/news/detail-605452.html
到了這里,關于【Bug解決】curl: (77) error setting certificate verify locations: CAfile: ..ssl/cacert.pem的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!