본문 바로가기

IT/Internet

[AdGuard Home] Let's encrypt SSL 인증서 설정

기존 certbot 제거

apt-get remove certbot

 

snap 설치

$ sudo apt update
$ sudo apt install snapd
You will also need to reboot your device. This can be accomplished from the terminal (and from the desktop), but make sure you save any open documents first:

$ sudo reboot
After this, install the core snap in order to get the latest snapd.

$ sudo snap install core

snap 을 통해 최신 certbot 설치

sudo snap install --classic certbot

심볼릭 링크 설정

sudo ln -s /snap/bin/certbot /usr/bin/certbot

 

ssl 인증서 발급

sudo certbot certonly \
  --agree-tos \
  --email someone@example.com \
  --manual \
  --preferred-challenges=dns \
  --preferred-chain="ISRG Root X1" \
  -d *.example.com \
  --server https://acme-v02.api.letsencrypt.org/directory
  • --certonly: ssl 인증서 발급 옵션
  • --agree-tos: Let's Encrypt 서비스약관 동의
  • --email: ssl 인증서를 연결할 이메일 주소. 만료될 때 여기로 알림이 옴. (이메일별로 발급 가능한 횟수에 제한이 있음)
  • --manual: 대화형 설치
  • --preferred-challenges: ssl 검증에 사용할 도메인 이름 확인 방법 = dns
  • --preferred-chain="ISRG Root X1" : 2021년 9월자로 DST Root CA X3 인증서가 만료됨에 따라 체인 끝 지점을 ISRG Root X1 으로 명시해줘야 함. 만약 그렇지 않으면 DNS over TLS 가 동작하지 않음. 
    관련 설명: https://ikarus.sg/lets-encrypt-dot-android/
  • --d: ssl 인증서 발급 대상 도메인. 가급적 와일드카드 도메인으로 한다. *.example.com
  • --server: ssl 인증서 발급 API 지정 

(만약 certbot 이 최신 버전이 아니면 --preferred-chain 파라미터가 동작하지 않으니 주의)

 

 

실행하면 아래와 같이 DNS TXT record 정보가 표시됨.

Please deploy a DNS TXT record under the name 
_acme-challenge.example.com with the following value: 

auOxWPuv-PLpBQUO7Mom4Amfxo3Ec19wCbZwnnydmxk
Before continuing, verify the record is deployed. 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Press Enter to Continue

 

 

도메인 DNS 리소스 레코드에 아래와 같이 입력하고 저장한다.

 

 

그 후 AdGuardHome > 설정 > 암호화 설정에서 인증서, 개인키 경로 지정

/etc/letsencrypt/live/examples.com/fullchain.pem

/etc/letsencrypt/live/example.com/privkey.pem

 

AdGuardHome 재시작

./AdGuardHome -s restart