Let’s Encrypt 갱신시 Cert not yet due for renewal 문제 해결 방법

서버 일반

이전 포스트에서 Let’s Encrypt 서비스를 이용해 무료로 인증서를 발급 받아 NGINX에 적용하고 자동으로 갱신하는 방법에 대한 글을 작성했었는데요.

Let’s Encrypt는 90일 주기로 인증서를 갱신해야 하는데 인증서가 만료되기 2주 전부터 갱신이 가능하며 갱신 날짜가 다가오면 인증서 발급시 입력했던 이메일 주소로 갱신 안내 메일이 오게 됩니다.

root@URANUS:/home/pg# letsencrypt renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/abc.com.conf
-------------------------------------------------------------------------------
Cert not yet due for renewal

The following certs are not due for renewal yet:
/etc/letsencrypt/live/abc.com/fullchain.pem (skipped)
No renewals were attempted.

보통 자동 갱신 설정을 해놓기 때문에 신경을 쓰지 않지만 서버 관리를 하다가 인증서 갱신이 되지 않은 것을 발견해 수동으로 letsencrypt renew 명령어를 입력하면 위와 같은 메시지가 출력되는 경우가 있는데요.

위 메시지는 갱신할 인증서 없다는 뜻인데 분명 인증서 갱신이 되지 않았음에도 불구하고 위와 같은 메시지가 나온다면 다음 사항을 체크해 봅니다.

브라우저 캐시 삭제

letsencrypt Cert not yet due for renewal 01 1

가장 초보적이지만 초보적이기 때문에 체크를 잘 하지 않는 부분입니다. 서버에서 인증서가 갱신이 되어도 브라우저에서 새로운 인증서를 받아오지 않았다면 이전 인증서 정보로 체크되기 때문에 브라우저의 캐시를 삭제 후 새로고침해 확인해 봅니다.

크롬 같은 경우 F12를 눌러 개발자 도구를 연 다음 새로고침 버튼을 길게 누르면 해당 사이트의 캐시만 삭제가 가능하니 참고하세요.

NGINX 또는 아파치 재시작

보통 하루에 한번씩 크론탭으로 인해 로그 파일이 순환되면서 NGINX 또는 아파치 데몬이 재시작 되긴 하지만 로그를 사용하지 않는 경우, 로그를 하루에 한번씩 갱신하는 설정을 하지 않는 경우에는 인증서가 갱신되어도 HTTP 데몬이 재시작 되지 않아 반영이 안되는 경우입니다.

간단하게 service nginx restart 또는 service apache2 restart (우분투 기준) 명령어로 데몬을 재시작 한 다음 인증서를 확인해 봅니다.

인증서 새로 발급

위 두 항목을 체크했는데도 상황에 변함이 없다면 letsencrypt renew 명령어 대신 인증서를 다시 발급 받는 것입니다.

인증서를 처음 발급 받을때와 같은 명령어를 입력하면 ‘What would you like to do?’ 라는 옵션을 선택할 수 있는데 2: Renew & replace the cert (limit ~5 per 7 days) 를 선택하면 되겠습니다.

과정은 아래를 참고하세요.

root@URANUS:/home/pg# letsencrypt certonly --webroot --webroot-path=/var/www/abc.com -d abc.com -d www.abc.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificat e name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/abc.com.conf)

What would you like to do?
-------------------------------------------------------------------------------
1: Keep the existing certificate for now
2: Renew & replace the cert (limit ~5 per 7 days)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for abc.com
http-01 challenge for www.abc.com
Using the webroot path /var/www/abc.com for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Unable to clean up challenge directory /var/www/abc.com/.well-known/acme-challen ge

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/abc.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/abc.com/privkey.pem
Your cert will expire on 2018-09-20. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- 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

root@URANUS:/home/pg# service nginx restart

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

Fill out this field
Fill out this field
유효한 이메일 주소를 입력해주세요.

Aws 라이트세일 비트나미 Phpmyadmin 접속 방법
AWS 라이트세일 비트나미 phpmyadmin 접속 방법
아마존 웹서비스(AWS)의 라이트세일에서 워드프레스 인스턴트를 생성하면 비트나미(Bitnami) 기반의 웹서버를 쉽게 만들 수 있습니다. NGINX, PHP, mysqlDB, phpmyadmin이 자동으로 세팅되는 비트나미를…
도메인 Ip 확인하는 4가지 방법
도메인 IP 확인하는 4가지 방법
인터넷은 IP 주소를 기반으로 연결되며 서버와 클라이언트, PC와 스마트폰 모두 고유의 IP를 가지고 있습니다. IP 주소는 숫자 배열로 이루어져 있어서…