概念上是透過可以執行網頁服務的主機,來處理 Let's Encrypt 的 challenge。使用 FTP 方式掛載 dcs.tn.edu.tw 的檔案系統,讓 dehydrated 程式可以寫入到 dcs.tn.edu.tw 主機的 .well-known 目錄,以利後續 challenge 動作。最後,將產出的私鑰與憑證相關檔案轉換成 *.pfx 格式,匯入至 cloud.tn.edu.tw 平台。
以 curlftpfs 掛載 dcs.tn.edu.tw 目錄 (以下使用 autofs 自動掛載)
# vim /etc/auto.misc chpsxoops -fstype=fuse,rw,umask=002 :curlftpfs#ftp\://chpsxoops\\chpsadmin\:密碼\@ftp.dcs.tn.edu.tw
# mkdir -p /misc/chpsxoops/site/wwwroot/.well-known/acme-challenge/
# vim /misc/chpsxoops/site/wwwroot/web.config <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension="." mimeType="text/plain" /> </staticContent> </system.webServer> </configuration>
# cd /etc # git clone https://github.com/lukas2511/letsencrypt.sh.git
# vim /etc/letsencrypt.sh/dcs.config WELLKNOWN=/misc/chpsxoops/site/wwwroot/.well-known/acme-challenge # /etc/letsencrypt.sh/dehydrated -c -d chpsxoops.dcs.tn.edu.tw --config /etc/letsencrypt.sh/dcs.config # INFO: Using main config file /etc/letsencrypt.sh/dcs.config Processing chpsxoops.dcs.tn.edu.tw + Checking domain name(s) of existing cert... unchanged. + Checking expire date of existing cert... + Valid till Sep 24 02:17:00 2017 GMT (Longer than 30 days). Skipping renew!
# cd /etc/letsencrypt.sh/certs/chpsxoops.dcs.tn.edu.tw # openssl pkcs12 -export -out /tmp/xoops.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem