Letsencrypt add domain to existing certificate [closed] Ask Question

Letsencrypt add domain to existing certificate [closed] Ask Question

I am just simply trying to add the domain test.example.com to the certificate that already exists for example.com. How do I add a domain to my existing certificate and replace the old certificate?

I have tried these few commands

./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

Result: both created a brand new cert in a new folder test.example.com-0001

./letsencrypt-auto certonly --renew-by-default  --expand -d test.example.com

Result: error folder test.example.com already exists.

./letsencrypt-auto renew --expand -d orange.fidka.com

Result: error, I can only renew if my certificate is expired.

ベストアンサー1

You need to specify all of the names, including those already registered.

I used the following command originally to register some certificates:

/opt/certbot/certbot-auto certonly --webroot --agree-tos -w /srv/www/letsencrypt/ \
--email [email protected] \
--expand -d example.com,www.example.com

...そして今、次のコマンドを使用して、登録を拡張し、新しいサブドメインを SAN として含めることに成功しました。

/opt/certbot/certbot-auto certonly --webroot --agree-tos -w /srv/www/letsencrypt/ \
--expand -d example.com,www.example.com,click.example.com

からドキュメンテーション:

--expand "既存の証明書が要求された名前のサブセットをカバーしている場合は、常にそれを拡張して追加の名前に置き換えます。"

nginx を実行している場合は、新しい証明書をロードするためにサーバーを再起動することを忘れないでください。

おすすめ記事