sdm 使用阿里雲域名申請 Let’s Encrypt 萬用字元 域名證書
安裝acme
進入 套件中心
點選安裝 Git Server 之後進入SSh會使用git命令
方法1---------------------------------------
獲取程式碼 git clone https://github.com/Neilpang/acme.sh.git
安裝指令碼 cd acme.sh ./acme.sh --install --force
方法2----------------------------------------
curl https://get.acme.sh | sh
進入目錄:
cd ~/.acme.sh/
修改 ~/.acme.sh/dnsapi/vim dns_ali.sh 檔案中的 Ali_Key="XXXXXX" Ali_Secret="XXXXXXX" 去除註釋填入阿里雲key
申請證書:
./acme.sh --issue --dns dns_ali -d mydomain.site -d *.mydomain.site
備註,90天以後更新證書時的命令為:
/acme.sh --renew -d mydomain.site -d *.mydomain.site
在等待120秒之後,證書就已經申請下來了,下面接著在NAS中部署證書,上一步中的證書申請時都下載到了~/.acme.sh/mydomain.site/,在DSM的File Station中找到該目錄,把私鑰、證書、中間證書下載到PC本地,這三個檔案分別是私鑰:mydomain.site.key、證書:mydomain.site.cer、中間證書:ca.cer,然後在DSM的控制面板中找到安全性,在“證書”中新建證書或替換已有證書,之後選擇匯入正整數,然後在私鑰、證書、中間證書的選項中分別選中剛剛下載的檔案,確定之後DSM會重啟應用程式門戶來應用新的證書。
注:申請時要有可用2級域名可用要不 *.mydomain.site 泛型可能驗證不過去。
參考
https://github.com/Neilpang/acme.sh/wiki/%E8%AF%B4%E6%98%8E
http://www.gebi1.com/thread-278832-1-1.html
https://frontenddev.org/article/use-acme-sh-deployment-let-s-encrypt-by-ali-cloud-dns-generic-domain-https-authentication.html