如何在尝试访问 HTTPS url 时使用 cURL 处理证书? [英] How do I deal with certificates using cURL while trying to access an HTTPS url?

查看:25
本文介绍了如何在尝试访问 HTTPS url 时使用 cURL 处理证书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 curl 时遇到以下错误:

<前>curl: (77) 错误设置证书验证位置:CA文件:/etc/ssl/certs/ca-certificates.crtCApath:无

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

解决方案

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

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

# apt-get install ca-certificates

在 CygWin 中通过 Apt-Cyg

# apt-cyg install ca-certificates

在 Arch Linux(树莓派)中

# pacman -S ca-certificates

<小时>

文档说明:

<块引用>

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

见:Debian -- 压缩包 ca-certificates 的详细信息

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?

解决方案

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

这篇关于如何在尝试访问 HTTPS url 时使用 cURL 处理证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆