WAVE Log
Let’s Encrypt の DNS-01 チャレンジで SSL 証明書を取得

新サーバーに Certbot クライアントをインストールします。参考:Certbot Instructions
まず、snapd をインストールし、自動起動有効+起動。

~]# dnf --enablerepo=epel install snapd ~]# systemctl enable --now snapd.socket

シンボリックリンクを作成。

~]# ln -s /var/lib/snapd/snap /snap

snap のパスが正しく更新されるようにするには、一度ログアウトして再度ログインするか、システムを再起動してください。

certbot をインストール。

~]# snap install --classic certbot

下記エラーが出たら、数分待ってから再度実行する。

error: too early for operation, device not yet seeded or device model not acknowledged

シンボリックリンクを作成。

~]# ln -s /snap/bin/certbot /usr/local/bin/certbot

Certbot を DNS-01 モードで実行。

~]# certbot certonly --manual --preferred-challenges dns -d wave440.com -d '*.wave440.com'

Enter

Saving debug log to /var/log/letsencrypt/letsencrypt.log Requesting a certificate for wave440.com and *.wave440.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please deploy a DNS TXT record under the name: _acme-challenge.wave440.com. with the following value: abc123 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press Enter to Continue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please deploy a DNS TXT record under the name: _acme-challenge.wave440.com. with the following value: xyz789 (This must be set up in addition to the previous challenges; do not remove, replace, or undo the previous challenge tasks yet. Note that you might be asked to create multiple distinct TXT records with the same name. This is permitted by DNS standards.) 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.wave440.com. Look for one or more bolded line(s) below the line ';ANSWER'. It should show the value(s) you've just added. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press Enter to Continue ← ※

※「Before continuing, verify the TXT record has been deployed.」のあとの「Press Enter to Continue」ではすぐに Enter せずに下記を行います。

-d wave440.com と -d '*.wave440.com' の 2 つのドメインに対してそれぞれ別の CERTBOT_VALIDATION が発行されるため TXT は2つ表示されています。

旧サーバーの DNS に TXT レコードを追加。(Serial も変更する)

~]# vi /var/named/wave440.com.db.wan

_acme-challenge.wave440.com. 60 IN TXT "abc123" _acme-challenge.wave440.com. 60 IN TXT "xyz789"

反映。

~]# rndc reload wave440.com

数分待って(5分ぐらい?)反映されたか確認。(TXT が返ってくれば成功)

~]# dig TXT _acme-challenge.wave440.com @8.8.8.8 +short

反映が確認できたら ※ の Enter を行う。

Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/wave440.com/fullchain.pem Key is saved at: /etc/letsencrypt/live/wave440.com/privkey.pem

mod_ssl インストール。

~]# dnf -y install mod_ssl

SSL 設定ファイル編集。

~]# vi /etc/httpd/conf.d/ssl.conf

変更追加

<VirtualHost _default_:443> Protocols h2 http/1.1 ・・・ ・・・ # Use separate log files for the SSL virtual host; note that LogLevel # is not inherited from httpd.conf. ErrorLog logs/ssl_error_log ↓↓↓ ErrorLog logs/error_log TransferLog logs/ssl_access_log ↓↓↓ CustomLog logs/access_log combined env=!no_log LogLevel warn ・・・ ・・・ #SSLProtocol all -SSLv3 #SSLProxyProtocol all -SSLv3 SSLProtocol TLSv1.2 TLSv1.3 SSLProxyProtocol TLSv1.2 TLSv1.3 ・・・ ・・・ SSLHonorCipherOrder on ・・・ ・・・ SSLCipherSuite PROFILE=SYSTEM ↓↓↓ SSLCipherSuite HIGH:!aNULL:!MD5:!3DES:!CAMELLIA:!AESCCM:!ECDSA ・・・ ・・・ SSLCertificateFile /etc/pki/tls/certs/localhost.crt ↓↓↓ SSLCertificateFile /etc/letsencrypt/live/wave440.com/fullchain.pem ・・・ ・・・ SSLCertificateKeyFile /etc/pki/tls/private/localhost.key ↓↓↓ SSLCertificateKeyFile /etc/letsencrypt/live/wave440.com/privkey.pem ・・・ ・・・ Header always set Strict-Transport-Security "max-age=15768000" </VirtualHost>

Apache 設定反映。

~]# systemctl reload httpd

ポート開放。

~]# firewall-cmd --add-service=https --zone=public --permanent ~]# firewall-cmd --reload