AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 394815
Accepted
Andrew
Andrew
Asked: 2012-06-02 09:45:20 +0800 CST2012-06-02 09:45:20 +0800 CST 2012-06-02 09:45:20 +0800 CST

如何在 RedHat 上更新 cURL CA 包?

  • 772

我遇到了与我的 cURL 版本捆绑在一起的 CA 包已过时的问题。

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

通读文档对我没有帮助,因为我不明白我需要做什么或如何做。我正在运行 RedHat,需要更新 CA 包。我需要做什么才能在 RedHat 上更新我的 CA 包?

redhat ssl certificate-authority curl
  • 7 7 个回答
  • 161633 Views

7 个回答

  • Voted
  1. Best Answer
    Nada
    2012-06-02T11:14:33+08:002012-06-02T11:14:33+08:00

    对于 RHEL 6 或更高版本,您应该使用update-ca-trust,如 lzap 在下面的回答中所述。

    --- 对于旧版本的 Fedora、CentOS、Redhat:

    Curl 使用系统默认的 CA 包存储在 /etc/pki/tls/certs/ca-bundle.crt 中。在更改它之前,请复制该文件,以便在需要时可以恢复系统默认值。您可以简单地将新的 CA 证书附加到该文件,或者您可以替换整个包。

    您是否也想知道从哪里获得证书?我(和其他人)推荐 curl.se/ca 。在一行中:

    curl https://curl.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
    

    Fedora Core 2 位置是/usr/share/ssl/certs/ca-bundle.crt.

    • 56
  2. lzap
    2014-10-08T03:38:30+08:002014-10-08T03:38:30+08:00

    在 RHEL 6+ 系统上执行此操作的推荐方法是使用update-ca-trust工具,该工具现已默认安装。

    # cat /etc/pki/ca-trust/source/README 
    This directory /etc/pki/ca-trust/source/ contains CA certificates and 
    trust settings in the PEM file format. The trust settings found here will be
    interpreted with a high priority - higher than the ones found in 
    /usr/share/pki/ca-trust-source/.
    
    =============================================================================
    QUICK HELP: To add a certificate in the simple PEM or DER file formats to the
                list of CAs trusted on the system:
    
                Copy it to the
                        /etc/pki/ca-trust/source/anchors/
                subdirectory, and run the
                        update-ca-trust
                command.
    
                If your certificate is in the extended BEGIN TRUSTED file format,
                then place it into the main source/ directory instead.
    =============================================================================
    
    Please refer to the update-ca-trust(8) manual page for additional information
    

    因此,您只需将您的 crt 文件拖放到/etc/pki/ca-trust/source/anchors/并运行该工具。完成工作。这是安全的,您不需要做任何备份。完整的手册页可以在这里找到:https ://www.mankier.com/8/update-ca-trust

    • 44
  3. Pik Master
    2012-10-20T02:58:17+08:002012-10-20T02:58:17+08:00

    可能取决于哪个版本的 Redhat。您可以通过执行以下操作找到实际更新文件的包:

    rpm -qf /etc/pki/tls/certs/ca-bundle.crt
    

    我的结果显示openssl-0.9.8e-12.el5需要更新。

    如果您的发行版中没有更新的证书,您必须按照 Nada 的回答手动更新。

    • 8
  4. mgorven
    2012-06-02T10:28:50+08:002012-06-02T10:28:50+08:00

    RHEL 提供 Mozilla CA 证书作为ca-certificates软件包的一部分(yum如果尚未安装,请安装它)。要告诉 cURL 使用这些,请--cacert像这样使用参数。

    curl --cacert /etc/ssl/certs/ca-bundle.crt https://google.com/
    
    • 6
  5. Adam Williamson
    2015-01-15T14:11:47+08:002015-01-15T14:11:47+08:00

    自 Dan Pritts 发表评论以来,Red Hat 一直在更频繁地更新受支持的 RHEL 版本的证书包;您可以在包更新日志中很容易地看到这一点。RHEL 6 的证书在 2013 年更新了两次,在 2014 年更新了两次。

    所有 RHEL 和相关/克隆/派生的发行版都在 提供了一个捆绑文件,/etc/pki/tls/certs/ca-bundle.crt而同一个文件在/etc/pki/tls/cert.pemcert.pemca-bundle.crtupdate-ca-trust

    在 RHEL 6 及更新版本中,该捆绑包是“ca-certificates”包的一部分。在 RHEL 5 及更早版本中,它是“openssl”包的一部分。

    在带有更新https://rhn.redhat.com/errata/RHEA-2013-1596.html和任何更新的 RHEL 的 RHEL 6 中,“共享系统证书”系统可用(您必须运行update-ca-trust enable才能启用它)并且最好方法是lzap给的。该系统的一个好处是它适用于基于 NSS 和 GnuTLS 的应用程序以及基于 OpenSSL 的应用程序。请注意,您也可以通过将证书放在目录中来不信任它/etc/pki/ca-trust/source/blacklist/。

    在 RHEL 5 及更早版本(以及 RHEL 6,如果您不想使用新系统)中,您可以通过将扩展名为.pem/etc/pki/tls/certs 的 PEM 格式证书文件放在 /etc/pki/tls/certs 中并运行c_rehash(可能还需要yum install /usr/bin/c_rehash). 这仅适用于使用 OpenSSL 默认信任库的软件。这比编辑或替换捆绑文件要好,因为它允许您继续接收捆绑文件的官方更新。

    直接使用捆绑文件位置之一的软件(而不是要求 OpenSSL 使用系统默认的信任库)将不遵守更改;如果你有这样的软件,你就无法编辑捆绑文件(或改进软件)。根本不使用 OpenSSL 的软件将不会遵守添加的证书。

    • 6
  6. Leonard
    2016-08-26T09:15:36+08:002016-08-26T09:15:36+08:00

    我只需要在一个旧的 RHEL5 机器上做这个。我遇到了问题 22...curl 会拒绝 https 下载,因为机器上的证书太旧而无法验证 curl.haxx.se 证书。

    我使用了 curl 的 --insecure 选项来强制 https 下载。(是的,我知道......这是“不安全的”。)

    卷曲https://curl.haxx.se/ca/cacert.pem --insecure -o /etc/pki/tls/certs/ca-bundle.crt

    • 3
  7. Jeremy
    2019-01-24T10:46:02+08:002019-01-24T10:46:02+08:00

    对于RHEL 6,我能够通过更新和重新安装来自 Red Hat 的最新 CA 证书包来解决这个问题:

    sudo yum update ca-certificates
    sudo yum reinstall ca-certificates
    

    (就我而言,这足以让更新的“Let's Encrypt Authority X3”签名证书受到信任。)

    • 1

相关问题

  • 如何设置 Redhat 对 ActiveDirectory 的用户进行身份验证

  • 如何从 RHEL 5 迁移到 CentOS 5?

  • 我应该将 Rails 应用程序部署到哪个目录?

  • 如何移动 MySQL 的数据目录?

  • RHEL 5.3 上可用的 yum 存储库

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve