大网数据广告活动
服务器运维问答

Let's encrypt: Remove only one hostname from certificate

· 52CE 我爱测

I have the following certificate: # 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…

问题原文

原帖链接 · manifestor · CC BY-SA 4.0

I have the following certificate:

# 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

Now what I want to do is to remove domain.example and www.domain.example from the certificate, because the web server has moved to another instance. The fact, that the DNS entries have been changed means, that the renewal process will fail if domain.example and www.domain.example are still part of the certificate, because the DNS entries point to another IP now.

How can I remove certain host names from a let's encrypt certificate without deleting the certificate and creating a new one?

社区高分解答

原帖链接 · Kurt Roeckx · CC BY-SA 4.0

You should use --cert-name together with the list of hostnames you want to keep. So:

certbot certonly --cert-name example.com -d imap.domain.example,mail.domain.example,pop.domain.example,smtp.domain.example

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-07-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。