【问题标题】:Wildcard SSL certificates for multiple subdomain多个子域的通配符 SSL 证书
【发布时间】:2019-01-17 15:39:07
【问题描述】:

我有一个包含多个客户端的系统。每个客户端都有自己的子域。

client1.example.com
client2.example.com
...

在服务器端,所有请求都重定向到*.example.com。然后我的业务逻辑读取子域(如client1)并相应地响应客户端。

所以基本上,我不在服务器上配置每个子域。我只是将它添加到我的数据库中,我的代码会正确处理它。

我正在尝试将通配符 SSL 证书应用于所有这些子域。另外,我希望所有未来的客户都能自动获得https。

但我不知道如何配置它。我试过使用Let's Encrypt,但没有运气。实际域 example.com 获取 https,但不是客户端域。

任何有关配置的帮助都会非常有帮助。 或者,可能是,这种设置是不可能的。我不知道。

请帮忙。

附: example.com 只是我指的一个虚拟域。

附言我在 Ubuntu 16.04 x64 上使用 apache2 网络服务器

【问题讨论】:

  • 除了example.com 之外,您还需要一个*.example.com 的通配符证书(可以在同一个证书中或两个单独的证书中)
  • @PatrickMevzek 我试过了。它不起作用。我正在获得client1 和client2 的自签名证书。当然,我可能在配置时搞砸了。所以我会再试一次。我只想知道这是否可能?因为,我在任何地方都找不到。

标签: apache ubuntu https ssl-certificate wildcard-subdomain


【解决方案1】:

嗯,这是可能的。我现在有一个 *.example.com 的证书,它适用于我所有的任意子域,即,

client1.example.com
client2.example.com
...

我按照以下步骤操作:

$ wget https://dl.eff.org/certbot-auto
$ chmod a+x ./certbot-auto

$ sudo ./certbot-auto certonly \
--server https://acme-v02.api.letsencrypt.org/directory \
--manual --preferred-challenges dns \
-d *.example.com

然后使用在/etc/letsencrypt/live/example.com/ 创建的文件,我从控制面板更新了值(我使用Vestacp)

cat /etc/letsencrypt/live/example.com/cert.pem
^ Copy contents into “SSL Certificate” field.

cat /etc/letsencrypt/live/example.com/privkey.pem
^ Copy contents into “SSL Key” field.

cat /etc/letsencrypt/live/example.com/chain.pem
^ Copy contents into “SSL CA / Intermediate” field.

根据您的控制面板进行更改。

关注this article了解详细步骤和说明。

【讨论】:

    猜你喜欢
    • 2012-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-23
    • 2017-04-30
    • 2017-07-04
    • 2018-11-30
    相关资源
    最近更新 更多