我得到以下错误使用卷曲:

curl: (77) error setting certificate verify locations:
  CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none

如何设置证书验证位置?


当前回答

视窗:-

证书从https://curl.se/docs/caextract.html下载 重命名cacert。Pem到curl-ca-bundle.crt 将文件添加到以下任何位置

查看详情https://curl.se/docs/sslcerts.html

其他回答

另一个解决这个问题的方法是禁用证书验证:

echo insecure >> ~/.curlrc

只要找到适合我的解决方案。

echo’cacert = / etc / ssl / certs / ca-certificates。欧洲委员会

我从这里找到了解

如果有人仍然有问题,试试这个,它对我很有效。 删除/etc/ssl/certs/目录下的文件 然后重新安装ca-certificates:

sudo apt install ca-certificates --reinstall

当我尝试安装Linuxbrew时,我这样做了。

似乎您的卷曲指向一个不存在的文件与CA证书或类似。

有关CA certs与curl的主要参考,请参见:https://curl.haxx.se/docs/sslcerts.html

从$ 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.