GitLab的证书适用于domain.com,而不是xxx.domain.com。

huangapple go评论56阅读模式
英文:

GitLab certificate is valid for domain.com, not xxx.domain.com

问题

在使用 Docker 内部的 Docker 构建软件包时,GitLab Runner 无法登录到我托管的 GitLab 服务器:

docker login xxx.example.com:5050 -u user -p password

容器守护程序的错误响应:从 "https://xxx.example.com:5050/v2/" 获取:x509 证书是有效的,但是为 example.com,而不是 xxx.example.com。

默认情况下,SSL 使用 LetsEncrypt 启用并且运行良好。在 GitLab 的官方文档中指出证书对所有子域都有效。

英文:

When using docker inside docker to build the packages the gitlab-runner wasn't able to login to my self-hosted gitlab server:
> docker login xxx.example.com:5050 -u user -p password
>
> Error response from daemon: Get "https://xxx.example.com:5050/v2/": x509: certificate is valid for example.com, not xxx.example.com

By default the SSL is enabled with LetsEncrypt and worked perfectly. Inside the official documentation of Gitlab it says the certificate is valid for all subdomains as well.

答案1

得分: 1

您似乎为“apex”域(即无子域)颁发了一个证书。普通证书不适用于子域,唯一的例外是“www”子域。您有三个选项:

  • subdomain.example.com 创建一个证书。
  • 创建一个通配符证书,适用于 *.example.com
  • 创建一个多域证书,适用于 example.comsubdomain.example.com;可能还适用于其他子域。一些证书颁发机构允许稍后扩展多域证书以包含额外的(子)域名,但请事先检查。

顺便说一下,考虑设置Let’s Encrypt,这样您就不必担心颁发更多的证书。

英文:

You seem to have issued a certificate for the “apex” domain (i.e. no subdomain). A normal certificate is not valid for subdomains, only exception is the www subdomain. You have three options:

  • Create a certificate for subdomain.example.com.
  • Create a wildcard certificate for *.example.com
  • Create a multidomain certificate for example.com and subdomain.example.com; potentially for other subdomains as well. Some CAs allow extending a multidomain certificate with additional (sub-)domains later on, but please check in advance.

By the way, consider setting up Let’s Encrypt, and you won’t have to worry about issuing more certificates.

答案2

得分: 0

经过长时间的调查,

我发现,我们在 xxxx.domain.com 上使用了与 domain.com 不同的证书。

在更改nginx内部配置后,一切都正常运行。

英文:

After a long investigation.

I found out, that we used a different certificate for xxxx.domain.com than the one for domain.com

After changing the configuration inside the nginx it worked smoothly.

huangapple
  • 本文由 发表于 2023年2月18日 16:44:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75492168.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定