我得到以下错误使用卷曲:
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
如何设置证书验证位置?
当前回答
创建一个文件~/。使用以下内容进行Curlrc
cacert=/etc/ssl/certs/ca-certificates.crt
如下
echo "cacert=/etc/ssl/certs/ca-certificates.crt" >> ~/.curlrc
其他回答
在git bash中运行以下命令,这对我来说很好
git config --global http.sslverify "false"
似乎您的卷曲指向一个不存在的文件与CA证书或类似。
有关CA certs与curl的主要参考,请参见:https://curl.haxx.se/docs/sslcerts.html
只需创建文件夹,这在您的系统中是缺失的..
/ etc / pki / tls证书
并使用以下命令创建文件,
Sudo apt-get install ca-certificates
然后复制并粘贴证书到目标文件夹,这是显示在您的错误..我的是“with message”错误设置证书验证位置:CAfile: /etc/pki/tls/certs/ca-bundle.请确保您将文件粘贴到错误中提到的确切位置。使用以下命令复制粘贴..
电脑:sudo cp /etc/ssl/证书/呆滞 / etc / pki / tls证书/ ca-bundle crt。
固定的。
把这个放到你的。bashrc中
# fix CURL certificates path
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
(见罗伯特的评论)
从$ 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.