Post

Certbot으로 Lets Encrypt wildcard 인증서 갱신하기

참고링크 : https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx

3개월전에 받은 Lets Encrypt 인증서가 오늘 만료되기에 갱신을 해 보기로 했다

단순히 renew를 했더니 안되더라 bash sudo certbot renew 아래와 같은 메시지가 뜨면서

1
2
Failed to renew certificate lunapiece.net with error: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.')

찾아보니 WildCard 인증서는 manual 모드로 받아야 하고, manual 모드는 renew 명령어로 갱신할 수 없다.
DNS의 TXT 레코드를 자동으로 변경할 수 없기 때문이다.
단 CloudFlare DNS 를 사용할 경우, 협의가 되어있는것인지 자동으로 처리할 수 있다고 한다.
아마 CloudFlare가 충분히 신뢰할 수 있는 업체라 인정한 것으로 보인다.
다음에 갱신 기간이 다가오면 그때는 CloudFlare 로 DNS를 옮길까 한다.

아무튼 아래 명령어로 renew를 진행하면, 이전처럼 _acme-challenge 서브도메인에 txt 레코드를 채워넣으라고 하며 값을 알려준다.

1
sudo certbot certonly -a manual -i nginx -d *.lunapiece.net -d *.gitlab-pages.lunapiece.net

그러면 이전과 같이 가만히 냅둔채로 dns 에서 txt 레코드를 설정한다.
https://toolbox.googleapps.com/apps/dig 등의 dns lookup 도구에서 txt 레코드가 정상적으로 반영된 것이 확인 될 때 까지 대기한다.

난 도메인 2개라서 2번 진행하니, Continue 를 한번 진행하여 값을 2개 다 받아놓은다음에 진행하는게 편할 것 같다. 이번엔 하나씩 따로 했는데 두번 기다리려니 상당히 귀찮다

이후 다 등록이 되면 끝이다. CertOnly 이기 떄문에 nginx 설정 변경할거냐고 안 물어본다.
부자되서 그냥 돈내고 인증서 사고 싶다. 더럽게 귀찮다…

This post is licensed under CC BY 4.0 by the author.