nasが使用するSSL証明書をmacで申請する
2024-04-13 09:49 ≈ 422字 ≈ 2分

Synology 独自の letsencrypt 証明書アプリケーションは http メソッドを使用するため、diskstation にポート 80 を使用するように要求する必要があります。ただし、ホーム ネットワークはデフォルトでポート 80 を閉じるため、どのように試しても失敗し、使用できるのはポート 80 のみです。ご自身のパソコンに来て応募してください。

一番面倒なのは3ヶ月ごとに更新する必要があり、毎回これをしなければならないこと…記録しておけば、世界中の注文を探す手間が省けます。

1.homebrewをインストールする

2.certbotをインストールする

1
brew install certbot
  1. コマンドを実行します。たとえば、ドメイン名は *.example.com です。
1
sudo certbot certonly --manual --preferred-challenges=dns -d "*.yourdomain.com"
  1. 残りは基本的にデフォルトで y を選択します。次の内容が表示されるまで、ドメイン名解決コンソールで TXT パーサーを追加する必要があります。追加後、約 10 分間待って Enter キーを押して次のステップに進みます。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Please deploy a DNS TXT record under the name:

_acme-challenge.example.com.

with the following value:

D1kOMANSfZG0HVM6-swGIqHrD87p7LGrnDLmoOclSuw

Before continuing, verify the TXT record has been deployed. Depending on the DNS
provider, this may take some time, from a few seconds to multiple minutes. You can
check if it has finished deploying with aid of online tools, such as the Google
Admin Toolbox: https://toolbox.googleapps.com/apps/dig/#TXT/_acme-challenge.wangboweb.site.
Look for one or more bolded line(s) below the line ';ANSWER'. It should show the
value(s) you've just added.
  1. 成功すると、次のプロンプトが表示されます。
1
2
3
4
5
6
7
8
9
10
11
12
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/example.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/example.com/privkey.pem
This certificate expires on 2022-12-23.
These files will be updated when the certificate renews.

NEXT STEPS:
- This certificate will not be renewed automatically. Autorenewal of --manual certificates requires the use of an authentication hook script (--manual-auth-hook) but one was not provided. To renew this certificate, repeat this same certbot command before the certificate's expiry date.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
  1. デフォルトで生成された証明書は /etc/letsencrypt/achive/example.com/ ディレクトリにありますが、このディレクトリにはデフォルトでアクセス許可がありません。コピーする必要がある場合は、右クリックするだけで済みます。フォルダーをクリックして、概要を表示し、アクセス許可を設定して、fullchain.pem と privkey.pem の 2 つのファイルをコピーします。

  2. Synology-コントロール パネル-セキュリティ-証明書に対応する証明書ファイルをアップロードします。