让我们加密:仅从证书中删除一个主机名

man*_*tor 10 ssl ssl-certificate lets-encrypt

我有以下证书:

# certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Found the following certs:
 Certificate Name: domain.example
  Domains: domain.example imap.domain.example mail.domain.example pop.domain.example smtp.domain.example www.domain.example
  Expiry Date: 2019-09-09 03:34:20+00:00 (VALID: 62 days)
  Certificate Path: /etc/letsencrypt/live/domain.example/fullchain.pem
  Private Key Path: /etc/letsencrypt/live/domain.example/privkey.pem
Run Code Online (Sandbox Code Playgroud)

现在我想做的是从证书中删除domain.example和,因为 Web 服务器已移动到另一个实例。www.domain.example事实上,DNS 条目已更改意味着,如果domain.examplewww.domain.example仍然是证书的一部分,则续订过程将会失败,因为 DNS 条目现在指向另一个 IP。

如何从 Let's Encrypt 证书中删除某些主机名,而不删除证书并创建新证书?

小智 13

您应该将 --cert-name 与要保留的主机名列表一起使用。所以:

certbot certonly --cert-name example.com -d imap.domain.example,mail.domain.example,pop.domain.example,smtp.domain.example
Run Code Online (Sandbox Code Playgroud)

请参阅https://certbot.eff.org/docs/using.html#changing-a-certificate-s-domains


Mic*_*ton 3

在这种情况下,我通常不会费心重新颁发证书。我只是编辑配置文件/etc/letsencrypt/renewal/example.com.conf并从其中删除域。下次续订时,新证书将不再包含已删除的域。

但就您而言,由于您要删除的名称是证书的原始名称,我建议您根本不要续订此证书,而是删除旧证书的续订配置文件,然后颁发仅包含名称的新证书你想保留。

  • 从 0.40.0 开始,主机名似乎不在该文件中? (2认同)