我得到以下错误使用卷曲:
curl: (77) error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none
如何设置证书验证位置?
我得到以下错误使用卷曲:
curl: (77) error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none
如何设置证书验证位置?
当前回答
另一个解决这个问题的方法是禁用证书验证:
echo insecure >> ~/.curlrc
其他回答
我还安装了最新版本的ca-certificates,但仍然出现错误:
curl: (77) error setting certificate verify locations:
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
问题是curl希望证书位于/etc/pki/tls/certs/ca-bundle.路径下但是无法找到它,因为它位于/etc/ssl/certs/ca-certificates.crt路径下。
通过运行将我的证书复制到预期的目的地
sudo cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
为我工作。如果目标目的地不存在文件夹,则需要运行命令为其创建文件夹
sudo mkdir -p /etc/pki/tls/certs
如果需要,修改上面的命令,使目标文件名与curl期望的路径匹配,即替换/etc/pki/tls/certs/ca-bundle.在错误消息中使用“CAfile:”后面的路径。
解决这个错误的最快方法是在curl请求中添加-k选项。该选项“允许连接到SSL引用而不需要证书”。(来自curl—help)
请注意,这可能意味着您并没有与您认为您正在与之通信的端点通信,因为它们正在提供一个没有由您信任的CA签名的证书。
例如:
$ curl -o /usr/bin/apt-cyg https://raw.github.com/cfg/apt-cyg/master/apt-cyg
给我以下错误响应:
curl: (77) error setting certificate verify locations:
CAfile: /usr/ssl/certs/ca-bundle.crt
CApath: none
我加了-k
curl -o /usr/bin/apt-cyg https://raw.github.com/cfg/apt-cyg/master/apt-cyg -k
并且没有错误消息。作为奖励,现在我已经安装了apt-cyg。和ca证书。
只要找到适合我的解决方案。
echo’cacert = / etc / ssl / certs / ca-certificates。欧洲委员会
我从这里找到了解
此错误与缺少一个包有关:ca-certificates。安装它。
在Ubuntu Linux(以及类似的发行版)中:
# apt-get install ca-certificates
通过Apt-Cyg在CygWin中
# apt-cyg install ca-certificates
在Arch Linux下(树莓派)
# pacman -S ca-certificates
文档告诉我们:
该包包含CA证书的PEM文件,允许基于SSL的应用程序检查SSL连接的真实性。
在Debian——压缩包ca-certificates的详细信息
我在Ubuntu 20.04 localhost上试图访问运行在docker容器中的elasticsearch时遇到了这个curl 77问题。集装箱启动后:
Check curl without ssl: curl --cacert http_ca.crt -u elastic https://localhost:9200 -k lowercase -k for insecure connection. Check curl configs: curl-config --configure, noticed what is ca-bundle: --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt. Copy http_ca.crt file from container to:/usr/local/share/ca-certificates/, original command is here. Run update on ca-certificates: sudo update-ca-certificates. Run curl: curl -u elastic:<password> https://localhost:9201. Finally got response with "tagline" : "You Know, for Search".
将<password>修改为运行Docker Image时生成的密码。 还要注意,在我的机器上,弹性是在端口9201上启动的(不知道为什么:sudo ss -tlpn | grep 9200给我什么都没有),我已经找到了端口:sudo netstat -ntlp和程序名称是docker-proxy。