pkg install acme.sh
curl https://get.acme.sh | sh -s email=my@example.com
wget -O - https://get.acme.sh | sh -s email=my@example.com
git clone https://github.com/acmesh-official/acme.sh.git cd ./acme.sh ./acme.sh --install -m my@example.com
curlやwgetでinstallした場合には設定されるがpkgでは設定されないので以下を参考に設定する
0 0 * * * /usr/local/sbin/acme.sh --cron --home "/home/user/.acme.sh" 2>&1 |logger -p local0.notice -t acme.sh
acme.sh --install-cert -d example.com \ --cert-file /path/to/certfile/in/apache/cert.pem \ --key-file /path/to/keyfile/in/apache/key.pem \ --fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \ --reloadcmd "service apache2 force-reload"
acme.sh --install-cert -d example.com \ --key-file /path/to/keyfile/in/nginx/key.pem \ --fullchain-file /path/to/fullchain/nginx/cert.pem \ --reloadcmd "service nginx force-reload"
| コマンド/オプション | 値の例 | 説明 |
|---|---|---|
| –install-cert | - | 鍵の配置とreload |
| -d | www.example.com | ドメイン(必須) |
| –cert-file | /path/to/certfile/in/apache/cert.pem | サーバ証明書ファイル |
| –key-file | path/to/keyfile/in/apache/key.pem | サーバの秘密鍵 |
| –fullchain-file | path/to/fullchain/certfile/apache/fullchain.pem | 中間認証局証明書+サーバ証明書ファイル |
| –reloadcmd | “service apache2 force-reload” | 再読み込みコマンド |
指定方法
acme.sh --issue .... --server letsencrypt_test -or- acme.sh --issue .... --server https://acme-staging-v02.api.letsencrypt.org/directory
| Short Name | ACME server URL | Usage Wiki | EAB |
|---|---|---|---|
| letsencrypt | https://acme-v02.api.letsencrypt.org/directory | N/A | N/A |
| letsencrypt_test | https://acme-staging-v02.api.letsencrypt.org/directory | N/A | N/A |
| buypass | https://api.buypass.com/acme/directory | BuyPass.com CA | 利用可 |
| buypass_test | https://api.test4.buypass.no/acme/directory | BuyPass.com CA | 利用可 |
| zerossl | https://acme.zerossl.com/v2/DV90 | ZeroSSL.com CA | 利用可 |
| sslcom | https://acme.ssl.com/sslcom-dv-rsa, https://acme.ssl.com/sslcom-dv-ecc | SSL.com CA | ? |
| https://dv.acme-v02.api.pki.goog/directory | Google Public CA / Google Trust Services CA | 必須 | |
| googletest | https://dv.acme-v02.test-api.pki.goog/directory | Google Public CA | 必須 |
EAB2)は他のCAでも利用できるはずだが、zerosslで作成したEABでgoogleのレジストを試したところ失敗しました3)
gcloudから取得すればOKでした。取得するにはProjectを作成して紐づけますので、「Google Cloud プロジェクトを削除すると、プロジェクトにリンクされているすべての ACME アカウントが無効になります」とのことです。
acme.sh --register-account -m myemail@example.com --server google \
--eab-kid xxxxxxx \
--eab-hmac-key xxxxxxx
acme.sh --register-account --server zerossl \
--eab-kid xxxxxxxxxxxx \
--eab-hmac-key xxxxxxxxx
$ acme.sh --list
acme.sh の管理下から証明書を削除するだけで、証明書自体は有効期限までは有効
$ acme.sh --remove -d <ドメイン名>