前言
certbot是一個免費的HTTPS證書提供工具,為letsencrypt所有。可以免費給一些域名”上鎖“,即將其從http變到https。
正文
當然這個證書有期限,為90天。
所以我們需要經常對其進行續期服務,並查看證書情況。
1. 續期
可使用下列2條命令:
1)
certbot --nginx certonly -n -d domain
其中,domain為需要續期的域名。
2)
certbot renew --cert-name domain --dry-run
其中,domain為需要續期的域名。
2. 查看證書
可使用下列命令:
certbot certificates
就可以看到當前機器所有域名的證書情況,包括域名、 到期日、證書路徑、私鑰路徑四條信息。