Files
document-haness/docs/keycloak-session-store/final/assets/renewal-to-serving-gap/renewal-to-serving-gap.alt.md
T

1.8 KiB
Raw Blame History

인증서 갱신이 서빙에 닿기까지

Alternative text

certbot 이 archive 에 새 인증서를 쓰고 live 링크를 옮기지만, nginx 워커가 교체되지 않아 옛 인증서를 계속 서빙하는 구성.

Long description

certbot renew 는 archive 디렉터리에 새 인증서를 쓰고 live 심볼릭 링크가 그것을 가리키게 한다. nginx 는 ssl_certificate 가 가리키는 파일을 기동 시점에 한 번 읽어 메모리에 보관하므로, 경로가 그대로여도 reload 없이는 옛 인증서를 계속 서빙한다. 이 실험대에서는 certbot-renew.service 의 ExecStartPost, renewal-hooks 의 세 디렉터리, certbot 의 nginx 플러그인이 모두 비어 있어 2305초 동안 옛 인증서가 서빙됐다. deploy 훅 하나를 넣자 같은 구간이 1~2초가 됐다.

Elements and evidence

  • certbot renew (process): ACME 로 새 인증서를 받아 archive 에 쓰고 live 링크를 옮긴다. Evidence: L1027L1032.
  • live/fullchain.pem (datastore): 심볼릭 링크. 경로는 그대로이고 가리키는 대상만 바뀐다. Evidence: L1066L1067.
  • renewal-hooks/deploy (process): 갱신이 실제로 일어났을 때만 실행된다. 이 실험대에서는 비어 있었다. Evidence: L1055L1062.
  • nginx 워커 (service): 기동 시점에 읽은 인증서를 메모리에 들고 있다. reload 해야 새 워커가 새 인증서를 읽는다. Evidence: L1077L1085.

Relationships

  • live/fullchain.pem → nginx 워커: reload 필요. Evidence: L1066L1067.
  • renewal-hooks/deploy → nginx 워커: reload 신호. Evidence: L1094L1099.
  • certbot renew → renewal-hooks/deploy: 갱신 성공 시 호출. Evidence: L1055L1062.
  • certbot renew → live/fullchain.pem: 새 인증서 기록. Evidence: L1032L1038.