前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >CA证书更新

CA证书更新

作者头像
Linux运维技术之路
发布2025-01-09 18:54:37
发布2025-01-09 18:54:37
10000
代码可运行
举报
运行总次数:0
代码可运行

一、问题

1、Linux 服务器访问https 提示不安全

代码语言:javascript
代码运行次数:0
复制
[root@-nx-data_processing_01_airflow ~]# curl https://gitlab.china.com/
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, 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.

二、解决方案

代码语言:javascript
代码运行次数:0
复制
yum install -y ca-certificates

三、详细文档

要更新本地服务器的 CA 证书,具体步骤如下,取决于你的 Linux 发行版:

对于 Ubuntu/Debian 系统:

  1. 更新包索引: sudo apt update
  2. 安装或更新 CA 证书包: sudo apt install --reinstall ca-certificates
  3. 更新 CA 证书: sudo update-ca-certificates

对于 CentOS/RHEL 系统:

  1. 更新包索引: sudo yum update
  2. 安装或更新 CA 证书包: sudo yum install -y ca-certificates
  3. 启用 CA 证书: sudo update-ca-trust force-enable
  4. 更新 CA 证书: sudo update-ca-trust extract

其他步骤:

  • 确保你的系统是最新的,以避免安全问题。
  • 如果使用的是自定义 CA 证书,可以手动将其添加到 /etc/ssl/certs 目录,并运行相应的更新命令。

完成后,可以通过以下命令验证 CA 是否更新成功:

代码语言:javascript
代码运行次数:0
复制
curl -v https://your-domain.com

如果仍有问题,检查系统日志和证书链以获取更多信息。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2025-01-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Linux运维技术之路 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、问题
  • 二、解决方案
  • 三、详细文档
    • 对于 Ubuntu/Debian 系统:
    • 对于 CentOS/RHEL 系统:
    • 其他步骤:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档