Centos7 不信任 Let encrypt 颁发的证书

Pav*_*oba 5 ssl-certificate

我有运行 https:// 的 apache nginx 服务器,并正确配置了 Letencrypt 证书。我可以连接火狐,铬,即。他们都报告连接是安全的。但是centos7和ubuntu 14.04报证书错误:

wget https://gitlab.timeless.cz:8443

Resolving gitlab.timeless.cz (gitlab.timeless.cz)... 82.100.8.23
Connecting to gitlab.timeless.cz (gitlab.timeless.cz)|82.100.8.23|:8443... connected.
ERROR: cannot verify gitlab.timeless.cz's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3’:
  Unable to locally verify the issuer's authority.
Run Code Online (Sandbox Code Playgroud)

根据https://www.ssllabs.com/页面是正确的。

输出

openssl s_client -connect gitlab.timeless.cz:8443
Run Code Online (Sandbox Code Playgroud)

CONNECTED(00000003)
depth=0 CN = gitlab.timeless.cz
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = gitlab.timeless.cz
verify error:num=27:certificate not trusted
verify return:1
depth=0 CN = gitlab.timeless.cz
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/CN=gitlab.timeless.cz
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
---
Run Code Online (Sandbox Code Playgroud)

但应该是这样的,这对 wget 和 curl 有效)

CONNECTED(00000003)
depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
 0 s:/CN=bk1.timeless.cz
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---
Run Code Online (Sandbox Code Playgroud)

我还有一些 apache 服务器,它们可以与 let-encrypt 证书一起正常工作。我的意思是 wget ...

我不知道为什么这在浏览器中有效,但在 cli 中无效。

编辑:

我在 Ubuntu 上使用从 omnibus 包安装的 gitlab,在 http 端口 8080 和 https 8443 上运行捆绑的 nginx。它默认安装了自签名证书。

然后我安装了 apache(标准端口 80,443)并使用 letencrypt-auto 实用程序对其进行配置。https 工作正常,受到所有人的信任。

首先,我尝试配置 apache 以终止 https 并将流量转发到未加密的 nginx(端口 8080)。它基本上有效,但我在登录和 git clone 时遇到了问题。这使它无法使用。

其次,我尝试将让为 apache 生成的加密证书链接到 nginx,但 /etc/gitlab/ssl 中只有 .crt 和 .key 文件。所以我不知道如何包含链证书。奇怪的是浏览器没有它也很开心,但是 wget、git 和 curl 却失败了。

今天我发现

https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab-omnibus-apache24.conf

并设法解决了我的第一个解决方案。这对我有用,因为我可以自动更新证书,并且可以使用 gitlab 的标准端口,最后我可以将一个 ip 用于多个服务。

解决第二个解决方案是将链包含到 nginx 中,但它是 giltab 捆绑的,因此正常配置不适用。

use*_*517 6

我最近遇到一个问题,C7 系统无法升级某些软件包,因为远程证书不受信任。我可以使用 wget 来验证这一点。经过一番搜索和绞尽脑汁后,我决定重新安装 ca-certificates 包

yum reinstall ca-certificates
Run Code Online (Sandbox Code Playgroud)

这解决了我的问题。尝试在运行 wget 的系统上重新安装 ca-certificates 软件包。


小智 6

在REDHAT 7/ CentOS 7/ Oracle Linux 7 中:

在您的环境中安装证书。

  1. 从以下位置下载活动 PEM 证书:https://letsencrypt.org/certificates/在 /etc/pki/ca-trust/source/anchors
  2. 执行:sudo update-ca-trust

就这样!