使用 Certbot 申請(qǐng) Let's Encrypt SSL 證書,并定時(shí)續(xù)期
網(wǎng)站有個(gè) SSL 證書,可以提高安全性、及提高搜索引擎的排名。
Let’s Encrypt SSL 證書是免費(fèi)的,可以用命令行申請(qǐng),也可以用命令行續(xù)期。
Let’s Encrypt 網(wǎng)站推薦用 cerbot 工具。這個(gè)工具軟件在不同的年份,有不同的用法(可能是不同軟件版本的命令行,參數(shù)與之前版本改動(dòng)較大),網(wǎng)上查到的往往行不通。這篇文章介紹當(dāng)前版本可用的命令行參數(shù)使用方法。
參考網(wǎng)站:
https://letsencrypt.org/zh-cn/
https://certbot.eff.org/instructions
a. 申請(qǐng)有通配符的域名 SSL 證書:
certbot certonly -d *.somedomain.com --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory
根據(jù)提示,輸入對(duì)應(yīng)的信息。生成證書后,可更改 nginx/apache 對(duì)應(yīng)的配置文件。
b. 定時(shí)運(yùn)行命令,續(xù)期 SSL 證書:
certbot certonly -d *.somedomain.com --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory
命令與前一步一樣。得到的提示不同,如下:
What would you like to do? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: Keep the existing certificate for now 2: Renew & replace the certificate (may be subject to CA rate limits) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
選擇 2,進(jìn)行 SSL 證書續(xù)期。續(xù)期后的證書,是覆蓋原有的。
-------此博客同時(shí)發(fā)表于 https://my.oschina.net/jacklondon,http://www.rzrgm.cn/jacklondon,https://www.zheguisoft.com/staff_blogs/jacklondon_chen/2022 ,歡迎轉(zhuǎn)載。
轉(zhuǎn)載請(qǐng)注明出處:
http://www.rzrgm.cn/jacklondon ;
歡迎訪問 http://www.zheguisoft.com/ 并提建議。

浙公網(wǎng)安備 33010602011771號(hào)