我得到以下错误使用卷曲:
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
如何设置证书验证位置?
当前回答
我也有这个问题。我的问题是这个文件:
/usr/ssl/certs/ca-bundle.crt
默认情况下只是一个空文件。因此,即使它存在,您仍然会得到错误,因为它不包含任何证书。你可以像这样生成它们:
p11-kit extract --overwrite --format pem-bundle /usr/ssl/certs/ca-bundle.crt
https://github.com/msys2/MSYS2-packages/blob/master/ca-certificates/ca-certificates.install
其他回答
我还安装了最新版本的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也很重要。
我维护的共享机器上的一个用户得到了这个错误。但原因是他们安装了Anaconda (http://continuum.io)。这样做会把Anaconda的二进制路径放在标准的$ path之前,并且它自带curl二进制文件,它很难找到安装在这台Ubuntu机器上的默认certs。
从$ man curl:
--cert-type <type>
(SSL) Tells curl what certificate type the provided certificate
is in. PEM, DER and ENG are recognized types. If not specified,
PEM is assumed.
If this option is used several times, the last one will be used.
--cacert <CA certificate>
(SSL) Tells curl to use the specified certificate file to verify
the peer. The file may contain multiple CA certificates. The
certificate(s) must be in PEM format. Normally curl is built to
use a default file for this, so this option is typically used to
alter that default file.
只要找到适合我的解决方案。
echo’cacert = / etc / ssl / certs / ca-certificates。欧洲委员会
我从这里找到了解
在git bash中运行以下命令,这对我来说很好
git config --global http.sslverify "false"