在尝试访问 HTTPS url 时,如何使用 cURL 处理证书?

发布于 2024-09-08 12:36:27 字数 169 浏览 2 评论 0原文

我使用curl 收到以下错误:

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

如何设置此证书验证位置?

I am getting the following error using curl:

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

How do I set this certificate verify locations?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(26

山色无中 2024-09-15 12:36:28

我也有这个问题。我的问题是这个文件:

/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

I had this problem as well. My issue was this file:

/usr/ssl/certs/ca-bundle.crt

is by default just an empty file. So even if it exists, you'll still get the error as it doesn't contain any certificates. You can generate them like this:

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

春风十里 2024-09-15 12:36:28

就我而言(在 Mac 上),我有一个 /etc/ssl/cert_new.pem 而不是默认的证书文件名 /etc/ssl/cert.pem。因此,我运行 sudo cp cert_new.pem cert.pem 并修复了所有 ssl 问题。

In my case (on Mac) I had a /etc/ssl/cert_new.pem instead of the default cert filename /etc/ssl/cert.pem. So I run sudo cp cert_new.pem cert.pem and all the ssl issues fixed.

痴者 2024-09-15 12:36:28

就我而言,这是一个权限问题

尝试

sudo curl .....

In my case, it was a permission issue

try

sudo curl .....
这样的小城市 2024-09-15 12:36:27

我还安装了最新版本的 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.crt 但找不到它,因为它位于路径 /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.crt ,其路径位于错误消息中的“CAfile:”之后。

I also had the newest version of ca-certificates installed but was still getting the error:

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

The issue was that curl expected the certificate to be at the path /etc/pki/tls/certs/ca-bundle.crt but could not find it because it was at the path /etc/ssl/certs/ca-certificates.crt.

Copying my certificate to the expected destination by running

sudo cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt

worked for me. You will need to create folders for the target destination if they do not exist by running

sudo mkdir -p /etc/pki/tls/certs

If needed, modify the above command to make the destination file name match the path expected by curl, i.e. replace /etc/pki/tls/certs/ca-bundle.crt with the path following "CAfile:" in your error message.

违心° 2024-09-15 12:36:27

此错误与缺少软件包有关:ca-certificates。安装它。

在 Ubuntu Linux(和类似发行版)中:

# apt-get install ca-certificates

在 CygWin 中,通过 Apt-Cyg

# apt-cyg install ca-certificates

在 Arch Linux (Raspberry Pi) 中)

# pacman -S ca-certificates

文档告诉:

此软件包包含 CA 证书的 PEM 文件,以允许基于 SSL 的应用程序检查 SSL 连接的真实性。

如下所示:Debian ——squeeze 中软件包 ca-certificates 的详细信息

This error is related to a missing package: ca-certificates. Install it.

In Ubuntu Linux (and similar distro):

# apt-get install ca-certificates

In CygWin via Apt-Cyg

# apt-cyg install ca-certificates

In Arch Linux (Raspberry Pi)

# pacman -S ca-certificates

The documentation tells:

This package includes PEM files of CA certificates to allow SSL-based applications to check for the authenticity of SSL connections.

As seen at: Debian -- Details of package ca-certificates in squeeze

陌伤浅笑 2024-09-15 12:36:27

将其放入您的 .bashrc

# fix CURL certificates path
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

(请参阅罗伯特的评论)

Put this into your .bashrc

# fix CURL certificates path
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

(see comment from Robert)

白鸥掠海 2024-09-15 12:36:27

创建文件~/.curlrc,内容

cacert=/etc/ssl/certs/ca-certificates.crt

如下

echo "cacert=/etc/ssl/certs/ca-certificates.crt" >> ~/.curlrc

Create a file ~/.curlrc with the following content

cacert=/etc/ssl/certs/ca-certificates.crt

as follows

echo "cacert=/etc/ssl/certs/ca-certificates.crt" >> ~/.curlrc
指尖上的星空 2024-09-15 12:36:27

解决该错误的最快方法是在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 证书。

The quickest way to get around the error is add on the -k option somewhere in your curl request. That option "allows connections to SSL cites without certs." (from curl --help)

Be aware that this may mean that you're not talking to the endpoint you think you are, as they are presenting a certificate not signed by a CA you trust.

For example:

$ curl -o /usr/bin/apt-cyg https://raw.github.com/cfg/apt-cyg/master/apt-cyg

gave me the following error response:

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

I added on -k:

curl -o /usr/bin/apt-cyg https://raw.github.com/cfg/apt-cyg/master/apt-cyg -k

and no error message. As a bonus, now I have apt-cyg installed. And ca-certificates.

白鸥掠海 2024-09-15 12:36:27

来自$ mancurl

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

From $ 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.
蛮可爱 2024-09-15 12:36:27

@roens是正确的。这会影响所有 Anaconda 用户,并出现以下错误
curl:(77) 设置证书验证位置时出错:
CA文件:/etc/pki/tls/certs/ca-bundle.crt
CApath:无

解决方法是使用默认的系统curl 并避免弄乱前置的Anaconda PATH 变量。您可以

  1. 重命名 Anaconda curl 二进制文件:)
    mv /path/to/anaconda/bin/curl /path/to/anaconda/bin/curl_anaconda

  2. 删除 Anaconda curl
    conda 删除curl

$whichcurl
/usr/bin/curl

[0] Anaconda Ubuntu Curl Github 问题 https://github.com/conda/conda-recipes/issues/352

@roens is correct. This affects all Anaconda users, with below error
curl: (77) error setting certificate verify locations:
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none

The workaround is to use the default system curl and avoid messing with the prepended Anaconda PATH variable. You can either

  1. Rename the Anaconda curl binary :)
    mv /path/to/anaconda/bin/curl /path/to/anaconda/bin/curl_anaconda

  2. OR remove Anaconda curl
    conda remove curl

$ which curl
/usr/bin/curl

[0] Anaconda Ubuntu curl Github issue https://github.com/conda/conda-recipes/issues/352

请远离我 2024-09-15 12:36:27

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

sudo apt install ca-certificates --reinstall

当我尝试安装 Linuxbrew 时就是这样做的。

If anyone is still having trouble, try this, it worked for me.
Delete the files in your /etc/ssl/certs/ directory
then reinstall ca-certificates:

sudo apt install ca-certificates --reinstall

Did this when I tried installing Linuxbrew.

濫情▎り 2024-09-15 12:36:27

我遇到了完全相同的问题。事实证明,我的 /etc/ssl/certs/ca-certificates.crt 文件格式错误。最后一个条目显示如下:

-----BEGIN CERTIFICATE-----
MIIEDTCCAvWgAwIBAgIJAN..lots of certificate text....AwIBAgIJAN-----END CERTIFICATE-----

-----END CERTIFICATE----- 之前添加换行符后,curl 能够处理证书文件。

发现这一点非常烦人,因为我的 update-ca-certificates 命令没有给我任何警告。

这可能是也可能不是卷曲的版本特定问题,所以这是我的版本,只是为了完整性:

curl --version
# curl 7.51.0 (x86_64-alpine-linux-musl) libcurl/7.51.0 OpenSSL/1.0.2j zlib/1.2.8 libssh2/1.7.0
# Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
# Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 

I had the exact same problem. As it turns out, my /etc/ssl/certs/ca-certificates.crt file was malformed. The last entry showed something like this:

-----BEGIN CERTIFICATE-----
MIIEDTCCAvWgAwIBAgIJAN..lots of certificate text....AwIBAgIJAN-----END CERTIFICATE-----

After adding a newline before -----END CERTIFICATE-----, curl was able handle the certificates file.

This was very annoying to find out since my update-ca-certificates command did not give me any warning.

This may or may not be a version specific problem of curl, so here is my version, just for completeness:

curl --version
# curl 7.51.0 (x86_64-alpine-linux-musl) libcurl/7.51.0 OpenSSL/1.0.2j zlib/1.2.8 libssh2/1.7.0
# Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
# Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 
少年亿悲伤 2024-09-15 12:36:27

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

echo insecure >> ~/.curlrc

Another alternative to fix this problem is to disable the certificate validation:

echo insecure >> ~/.curlrc
失退 2024-09-15 12:36:27

对于在 Windows 上的 XAMPP 上运行的 PHP 代码,我发现需要编辑 php.ini 以包含以下内容

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = curl-ca-bundle.crt

,然后复制到文件 https://curl.haxx.se/ca/cacert.pem 并重命名为curl-ca-bundle.crt并将其放在\xampp路径下(我无法将curl.capath获取到工作)。我还发现 cURL 站点上的 CAbundle 不足以支持我要连接的远程站点,因此使用了 http://winampplugins.co.uk/curl/

For PHP code running on XAMPP on Windows I found I needed to edit php.ini to include the below

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = curl-ca-bundle.crt

and then copy to a file https://curl.haxx.se/ca/cacert.pem and rename to curl-ca-bundle.crt and place it under \xampp path (I couldn't get curl.capath to work). I also found the CAbundle on the cURL site wasn't enough for the remote site I was connecting to, so used one that is listed with a pre-compiled Windows version of curl 7.47.1 at http://winampplugins.co.uk/curl/

深巷少女 2024-09-15 12:36:27

这对我有用

sudo apt-get install ca-certificates

,然后进入证书文件夹,然后

sudo cd /etc/ssl/certs

将 ca-certificates.crt 文件复制到 /etc/pki/tls/certs

sudo cp ca-certificates.crt /etc/pki/tls/certs

如果没有 tls/certs 文件夹:创建一个并使用 chmod 777 -R 文件夹名称更改权限

This worked for me

sudo apt-get install ca-certificates

then go into the certificates folder at

sudo cd /etc/ssl/certs

then you copy the ca-certificates.crt file into the /etc/pki/tls/certs

sudo cp ca-certificates.crt /etc/pki/tls/certs

if there is no tls/certs folder: create one and change permissions using chmod 777 -R folderNAME

梦旅人picnic 2024-09-15 12:36:27

默认情况下,curl 使用“捆绑包”执行 SSL 证书验证
证书颁发机构 (CA) 公钥(CA 证书)。默认
捆绑包名为curl-ca-bundle.crt;您可以指定一个备用文件
使用 --cacert 选项。

如果此 HTTPS 服务器使用由中表示的 CA 签名的证书
捆绑包中,证书验证可能由于以下原因失败
证书有问题(可能已过期,或者名称可能已过期)
与 URL 中的域名不匹配)。

如果您想关闭curl对证书的验证,请使用
-k(或 --insecure)选项。

例如

curl --insecure http://........

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). The default
bundle is named curl-ca-bundle.crt; you can specify an alternate file
using the --cacert option.

If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).

If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

for example

curl --insecure http://........
一口甜 2024-09-15 12:36:27

您的curl 似乎指向一个不存在的带有CA 证书或类似文件的文件。

有关使用curl 进行CA 证书的主要参考,请参阅:https://curl.se/docs/sslcerts。 html

It seems your curl points to a non-existing file with CA certs or similar.

For the primary reference on CA certs with curl, see: https://curl.se/docs/sslcerts.html

空心↖ 2024-09-15 12:36:27

只需创建系统中缺少的文件夹即可。

/etc/pki/tls/certs/

并使用以下命令创建文件,

sudo apt-get install ca-certificates

,然后将证书复制并粘贴到目标文件夹,该文件夹显示在您的错误中。我的是“ with message 'errorsettingcertificatelocations: CAfile: /etc/pki/ tls/certs/ca-bundle.crt CApath: none' in " 确保将文件粘贴到错误中提到的确切位置。使用以下命令复制粘贴..

sudo cp /etc/ssl/certs/ca-certificates.crt
/etc/pki/tls/certs/ca-bundle.crt

已修复。

Just create the folders, which is missing in your system..

/etc/pki/tls/certs/

and create the file using the following command,

sudo apt-get install ca-certificates

and then copy and paste the certificate to the destination folder, which is showing in your error.. mine was " with message 'error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none' in " make sure you paste the file to the exact location mentioned in the error. Use the following command to copy paste..

sudo cp /etc/ssl/certs/ca-certificates.crt
/etc/pki/tls/certs/ca-bundle.crt

Fixed.

油饼 2024-09-15 12:36:27

对于 Windows:-

  1. https://curl.se/docs/caextract.html 下载证书

  2. https://curl.se/docs/caextract.html

    将 cacert.pem 重命名为curl-ca-bundle.crt

  3. 将文件添加到以下任意位置

在此处输入图像描述

查看此内容了解详细信息 https:// /curl.se/docs/sslcerts.html

For windows :-

  1. Download the certificate from https://curl.se/docs/caextract.html

  2. Rename cacert.pem to curl-ca-bundle.crt

  3. Add the file to any of the below locations

enter image description here

Check this for details https://curl.se/docs/sslcerts.html

娇柔作态 2024-09-15 12:36:27

我在尝试访问 Ubuntu 20.04 本地主机上的 docker 容器中运行的 elasticsearch 时遇到了这个curl 77问题。启动容器后:

  1. 检查不带 ssl 的curl:curl --cacert http_ca.crt -u elastic https://localhost:9200 -k 小写-k for不安全的连接。

  2. 检查curl配置:curl-config --configure,注意到什么是ca-bundle:--with-ca-bundle=/etc/ssl/certs/ca-certificates。 crt.

  3. 将http_ca.crt文件从容器复制到:/usr/local/share/ca-certificates/,原始命令是此处

  4. 对 ca 证书运行更新:sudo update-ca-certificates

  5. 运行curl:curl -u elastic:<密码>; https://localhost:9201
    最终得到了“tagline”的回复:“你知道,用于搜索”

更改<密码>到运行 Docker Image 时生成的那个。
另请注意,在我的机器上,elastic 是在端口 9201 上启动的(不知道为什么: sudo ss -tlpn | grep 9200 没有给我任何结果),我找到了该端口: sudo netstat -ntlp 和程序名称是 docker-proxy。

I came across this curl 77 problem while was trying to access elasticsearch running in docker container on Ubuntu 20.04 localhost. Afrer container was started:

  1. Check curl without ssl: curl --cacert http_ca.crt -u elastic https://localhost:9200 -k lowercase -k for insecure connection.

  2. Check curl configs: curl-config --configure, noticed what is ca-bundle: --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt.

  3. Copy http_ca.crt file from container to:/usr/local/share/ca-certificates/, original command is here.

  4. Run update on ca-certificates: sudo update-ca-certificates.

  5. Run curl: curl -u elastic:<password> https://localhost:9201.
    Finally got response with "tagline" : "You Know, for Search".

Change <password> to the one that was generated when Docker Image was run.
Also notice that on my machine elastic was started on port 9201 (don't know why: sudo ss -tlpn | grep 9200 gives me nothing), I have found the port with: sudo netstat -ntlp and Programm name was docker-proxy.

小清晰的声音 2024-09-15 12:36:27

我遇到了同样的问题:我正在构建一个基于 alpine 的 docker 映像,当我想卷曲到我的组织的网站时,会出现此错误。为了解决这个问题,我必须获得我公司的 CA 证书,然后,我必须将其添加到我的映像的 CA 证书中。

  • 获取 CA 证书

使用 OpenSSL 获取与网站相关的证书:

openssl s_client -showcerts -servername my.company.website.org -connect my.company.website.org:443

这将输出类似以下

CONNECTED(00000005)
depth=2 CN = UbisoftRootCA
verify error:num=19:self signed certificate in certificate chain
...
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
... 
-----END CERTIFICATE-----
...

内容:获取最后一个证书(-----BEGIN CERTIFICATE-----

-----END CERTIFICATE----- 标记)并将其保存到文件中(例如 mycompanyRootCA.crt)

  • 构建您的镜像

然后,当您从 alpine 构建 docker 镜像时,执行以下操作:

FROM alpine
RUN apk add ca-certificates curl
COPY mycompanyRootCA.crt  /usr/local/share/ca-certificates/mycompanyRootCA.crt
RUN update-ca-certificates

您的图像现在可以正常工作了!

I've got the same problem : I'm building an alpine based docker image, and when I want to curl to a website of my organisation, this error appears. To solve it, I have to get the CA cert of my company, then, I have to add it to the CA certs of my image.

  • Get the CA certificate

Use OpenSSL to get the certificates related to the website :

openssl s_client -showcerts -servername my.company.website.org -connect my.company.website.org:443

This will output something like :

CONNECTED(00000005)
depth=2 CN = UbisoftRootCA
verify error:num=19:self signed certificate in certificate chain
...
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
... 
-----END CERTIFICATE-----
...

Get the last certificate (the content between the -----BEGIN CERTIFICATE----- and the
-----END CERTIFICATE----- markups included) and save it into a file (mycompanyRootCA.crt for example)

  • Build your image

Then, when you'll build your docker image from alpine, do the following :

FROM alpine
RUN apk add ca-certificates curl
COPY mycompanyRootCA.crt  /usr/local/share/ca-certificates/mycompanyRootCA.crt
RUN update-ca-certificates

Your image will now work properly!

听,心雨的声音 2024-09-15 12:36:27

我曾经在运行 composer update 时遇到此错误
我尝试了所有重新安装证书文件的命令,但问题没有解决。

我意识到错误是由于权限造成的
所以用这个命令解决了问题

cd /etc/ssl

sudo chmod 755 -R certs/

I used to get this error when run composer update
And I tried all the commands to reinstall the cert file, but the problem was not solved.

I realized that the error is due to permission
So the problem was solved with this command

cd /etc/ssl

sudo chmod 755 -R certs/
梦途 2024-09-15 12:36:27

就其价值而言,检查正在运行哪个curl 也很重要。

我维护的共享计算机上的一个用户遇到了此错误。但事实证明,原因是他们安装了 Anaconda (http://continuum.io)。这样做将 Anaconda 的二进制路径放在标准 $PATH 之前,并且它带有自己的 curl 二进制文件,它很难找到默认的证书。 > 安装在这台 Ubuntu 机器上。

For what it's worth, checking which curl is being run is significant too.

A user on a shared machine I maintain had been getting this error. But the cause turned out to be because they'd installed Anaconda (http://continuum.io). Doing so put Anaconda's binary path before the standard $PATH, and it comes with its own curl binary, which had trouble finding the default certs that were installed on this Ubuntu machine.

单挑你×的.吻 2024-09-15 12:36:27

只是发现这个解决方案非常适合我。

echo 'cacert=/etc/ssl/certs/ca-certificates.crt' > ~/.curlrc

我从 这里

Just find this solution works perfectly for me.

echo 'cacert=/etc/ssl/certs/ca-certificates.crt' > ~/.curlrc

I found this solution from here

jJeQQOZ5 2024-09-15 12:36:27

在 git bash 中运行以下命令对我来说效果很好

git config --global http.sslverify "false"

Run following command in git bash that works fine for me

git config --global http.sslverify "false"
若言繁花未落 2024-09-15 12:36:27

我使用 MobaXterm,实习生使用 Cygwin,所以即使使用 apt-cyg install ca-certificates 安装 ca-certificates 之后问题也没有解决。

我仍然收到以下错误:

curl: (77) error settingcertificate verifylocations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none

然后我尝试列出文件 < code>/etc/ssl/certs/ca-certificates.crt 我找不到它。不过,我可以找到包含所有标准 CA 证书的 /usr/ssl/certs/ca-bundle.crt ,因此我复制了文件 /usr/ssl/certs/ca-bundle.crt code> as /etc/ssl/certs/ca-certificates.crt 问题得到解决。

I use MobaXterm which intern uses Cygwin so even after installing ca-certificates using apt-cyg install ca-certificates problem didn't resolve.

I was still getting the following error:

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

Then I tried listing the file /etc/ssl/certs/ca-certificates.crt and I couldn't find it. However I could find /usr/ssl/certs/ca-bundle.crt with all standard CA certificates so I copied the file /usr/ssl/certs/ca-bundle.crt as /etc/ssl/certs/ca-certificates.crt and problem got resolved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文