更新Let's Encrypt電子證書

支 持 本 站: 捐贈伺服器等運維費用,需要您的支持!

電子證書快要過期了,所以再次玩起Let's Encrypt

先執行命令,
$ certbot --config-dir ~/letsencrypt/etc --work-dir ~/letsencrypt/lib --logs-dir ~/letsencrypt/log certonly --manual -d yinlei.org -d www.yinlei.org -d yinlei.net -d www.yinlei.net

然後與上次一樣, 會出現提示,要求在伺服器上作出.well-known/acme-challenge/下的認證文件,
做好後,得到如下資訊。
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
~/letsencrypt/etc/live/yinlei.org/fullchain.pem. Your
cert will expire on 2017-06-28. To obtain a new or tweaked version
of this certificate in the future, simply run certbot again. To
non-interactively renew *all* of your certificates, run "certbot
renew"


支 持 本 站: 捐贈伺服器等運維費用,需要您的支持!

看看etc/live/yinlei.org/下面
$ ls -l
total 32
lrwxr-xr-x 1 laoyanhunhua staff 34 3 30 19:07 cert.pem -> ../../archive/yinlei.org/cert2.pem
lrwxr-xr-x 1 laoyanhunhua staff 35 3 30 19:07 chain.pem -> ../../archive/yinlei.org/chain2.pem
lrwxr-xr-x 1 laoyanhunhua staff 39 3 30 19:07 fullchain.pem -> ../../archive/yinlei.org/fullchain2.pem
lrwxr-xr-x 1 laoyanhunhua staff 37 3 30 19:07 privkey.pem -> ../../archive/yinlei.org/privkey2.pem

原來生成了新的cert2.pem等文件。

接下來把新的證書傳到伺服器上,先上傳新的private2.pem密匙文件,
然後把新的證書cert2.pem拷貝過去,
最後把新的中間證書chain2.pem也上傳完畢。
(SSLサーバ証明書→ドメイン設定→SSL 証明書 更新→ 秘密鍵を含む新しい設定の作成→
秘密鍵をアップロードする→証明書のインストール→中間証明書のインストール
)

在瀏覽器里看一下,果然證書的有效日期已經改到3個月後了。

註:
Let's Encrypt電子證書不支持wildcats通配符多域名,但是支持SAN(Subject Alternative Name),
所以一個證書中可以包括多個域名,命令中使用-d選項來指定yinlei.org和www.yinlei.org。
當然wildcats最好,不用一個一個地把子域名寫出來,不過好在本站就是2個而已,倒也並不麻煩。

支 持 本 站: 捐贈伺服器等運維費用,需要您的支持!