[Let’s Encrypt] 在已有的憑證中加入新的網域名稱

查看目前憑證資訊

顯示目前的憑證資訊

cd /usr/local/letsencrypt 
sudo ./letsencrypt-auto certificates

輸出的憑證資訊

-------------------------------------------------------------------------------
Found the following certs:
  Certificate Name: sub.example.com
    Domains: sub.example.com
    Expiry Date: 2017-08-07 17:28:00+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/sub.example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/sub.example.com/privkey.pem
  Certificate Name: mydomain.com
    Domains: mydomain.com www.mydomain.com 
    Expiry Date: 2017-08-07 18:24:00+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/mydomain.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/mydomain.com/privkey.pem
-------------------------------------------------------------------------------

 


新增網域名稱

假設原有憑證包含的網域為 aaa.sample.com, bbb.sample.com 而我們要新增的子網域為ccc.sample.com

sudo ./letsencrypt-auto --apache --cert-name example.com -d aaa.example.com -d bbb.example.com -d ccc.example.com

此時letsencrypt-auto會詢問是否要更新憑證,輸入U即可

-------------------------------------------------------------------------------
Confirm that you intend to update certificate mydomain.com to include domains
[u'mydomain.com', u'www.mydomain.com', u'cdn.mydomain.com']. Note that it previously
contained domains [u'mydomain.com', u'www.mydomain.com'].
-------------------------------------------------------------------------------
(U)pdate cert/(C)ancel: U

最後重啟Apache就完成囉

sudo service apache2 restart

 

 

參考連結:How can I add more subdomains to my SSL Certificate?

Share This:

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *