取得單一網域名稱之憑證:
在電腦上沒有安裝或啟動web server的情況下,執行:
certbot certonly --standalone
之後輸入要申請的網域名稱,如果成功即可取得憑證。
取的網域名稱下全部名稱之憑證(wildcard):
申請此類憑證,必須擁有DNS內容的管理權限,才可通過檢核。
執行:
certbot certonly --manual --agree-tos -d "*.your.domain" -d your.domain --email email@your.domain --preferred-challenges dns --manual-public-ip-logging-ok --server https://acme-v02.api.letsencrypt.org/directory
之後會要求在DNS中新增一筆TXT紀錄,如:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.your.domain with the following value:
ngXxX_D-aIJkc8q7dgnMEzSBuWCgmvAurP8sshgA40Y
Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
之後依照指示在DNS中加入_acme-challenge.your.domain的TXT紀錄,如內容所示,確定可以查詢到該筆TXT紀錄後,即可按下enter,如果成功即可取得憑證。
如果 domain 有兩筆以上,會分別顯示多個TXT紀錄,請同時將多個TXT紀錄加到DNS中。
憑證的效期均為90天。