Jef*_*ort 109 ssl ssl-certificate lets-encrypt
我只是简单地尝试将域test.example.com添加到example.com已存在的证书中.如何将域添加到现有证书并替换旧证书?
我试过这些命令
./letsencrypt-auto certonly --cert-path /etc/letsencrypt/archive/example.com --expand -d test.example.com
./letsencrypt-auto certonly -d example.com --expand -d test.example.com
Run Code Online (Sandbox Code Playgroud)
结果:两者都在新文件夹test.example.com-0001中创建了一个全新的证书
./letsencrypt-auto certonly --renew-by-default --expand -d test.example.com
Run Code Online (Sandbox Code Playgroud)
结果:错误文件夹test.example.com已存在.
./letsencrypt-auto renew --expand -d orange.fidka.com
Run Code Online (Sandbox Code Playgroud)
结果:错误,我只能在证书过期时续订.
Sim*_*pel 122
您需要指定所有名称,包括已注册的名称.
我最初使用以下命令来注册一些证书:
/opt/certbot/certbot-auto certonly --webroot --agree-tos -w /srv/www/letsencrypt/ \
--email me@example.com \
--expand -d example.com,www.example.com
Run Code Online (Sandbox Code Playgroud)
...刚才我成功使用以下命令扩展我的注册,以包含一个新的子域作为SAN:
/opt/certbot/certbot-auto certonly --webroot --agree-tos -w /srv/www/letsencrypt/ \
--expand -d example.com,www.example.com,click.example.com
Run Code Online (Sandbox Code Playgroud)
从文档:
--expand"如果现有证书涵盖了所请求名称的某些子集,请始终展开并将其替换为其他名称."
如果您正在运行nginx,请不要忘记重新启动服务器以加载新证书.
emb*_*mbe 30
这是我注册我的域名的方式:
sudo letsencrypt --apache -d mydomain.com
Run Code Online (Sandbox Code Playgroud)
然后可以使用与其他域相同的命令并按照说明操作:
sudo letsencrypt --apache -d mydomain.com,x.mydomain.com,y.mydomain.com
Run Code Online (Sandbox Code Playgroud)
che*_*zeh 26
Ubuntu上的Apache,使用Apache插件:
sudo certbot certonly --cert-name example.com -d m.example.com,www.m.example.com
Run Code Online (Sandbox Code Playgroud)
有关更改证书域名的Certbot用户指南中生动地说明了上述命令.请注意,更改证书域名的命令也适用于添加新域名.
编辑
如果运行上面的命令,则会显示错误消息
具有当前所选验证器的客户端不支持满足CA的任何挑战组合.
您可以通过再次运行certbot来替换证书。 ./certbot-auto certonly
如果您尝试为现有证书已经覆盖的域生成证书,则系统将提示您此消息:
-------------------------------------------------------------------------------
You have an existing certificate that contains a portion of the domains you
requested (ref: /etc/letsencrypt/renewal/<domain>.conf)
It contains these names: <domain>
You requested these names for the new certificate: <domain>,
<the domain you want to add to the cert>.
Do you want to expand and replace this existing certificate with the new
certificate?
-------------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
只需选择Expand并替换它。
通过使用--cert-name结合使用--expand选项,我能够为一个域和多个子域设置SSL证书。
请参阅https://certbot.eff.org/docs/using.html上的官方certbot-auto文档
例:
certbot-auto certonly --cert-name mydomain.com.br \
--renew-by-default -a webroot -n --expand \
--webroot-path=/usr/share/nginx/html \
-d mydomain.com.br \
-d www.mydomain.com.br \
-d aaa1.com.br \
-d aaa2.com.br \
-d aaa3.com.br
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
115382 次 |
| 最近记录: |