주 메뉴 열기

wwiki β

바뀜

Let's Encrypt certificate

833 바이트 추가됨, 2021년 8월 14일 (토) 09:45
편집 요약 없음
서비스 유닛도 추가된다. (데비안 계열의 경우 /lib/systemd/system/certbot.service, /lib/systemd/system/certbot.timer )
$ sudo apt-get install certbot python-certbot-nginx
certbot.timer에 의해 하루2회 인증서를 자동갱신한다.
$ sudo certbot certificates
== 플러그인 ==플러그인은 인증서 발급과 인증서 설치 플러그인으로 구분된다.{| class="wikitable"|+플러그인의 종류!플러그인!발급 ==!설치!!|-|nginx|Y|Y||http방식|-|webroot|Y|N|구동중인 웹서버의 디렉토리를 사용하여 인증서를 발급한다.|http방식|-|standalone|Y|N|standalone web server를 사용하여 인증서를 발급한다. 80번 포트가 사용가능해야 한다. 웹 서버가 설치되지 않은 경우에 유용하다.|http방식|-|DNS plugins|Y|N|플러그인이 DNS record를 수정해서 인증서를 발급한다.|dns방식|-|manual|Y|N|도메인 유효성을 직접 수행해서 인증서를 발급한다. |http방식 또는 dns방식|}
=== standalone방식 standalone ===
일시적으로 웹 서비스를 빌려 인증서 유효성을 확인하는 방법이다. 여러 도메인을 발급받을 수 있으나 웹서비스를 중단시키고 발급등을 진행해야 한다.
$ sudo systemctl stop nginx.service
$ sudo certbot certonly --standalone -d [도메인명]
=== Webroot방식 Webroot ===
웹 디렉토리 내에 인증서의 유효성을 확인할 수 있는 파일을(Challenge Seed) 업로드하여 인증서를 발급하는 방법이다. Challenge Seed를 외부에서 접속 가능한 미리 약속된 경로(/.well-known)에 위치시킨 뒤 Let's Encrypt 서버가 해당 경로로 접속해 인증에 필요한 정보를 읽어간다. 그러므로, ProxyPass로 동작하는 가상호스트에도 적용이 가능하다.
</syntaxhighlight>nginx를 사용하는 경우 웹서비스 설정파일의 server 블록에 다음과 같이 입력하여 /.well-known URI가 /var/www/certbot을 가르키도록 한다.<syntaxhighlight lang="text">
location /.well-known {
root /var/www/certbot-webroot/;
}
</syntaxhighlight><br /> $ sudo certbot certonly --webroot -d [도메인명]
=== DNS방식 manual ===
도메인을 쿼리하여 나타나는 txt레코드에서 인증서 유효성을 확인하는 방법이다. 와일드카드 인증서의 경우 이 방식만을 사용한다.
== certbot SubCommand SubCommands ==
=== certonly ===
=== run (default) ===
인증서를 발급하고 설치한다. Obtain & install a certificate in your current webserver. 도메인 목록에서 선택하여 인증서를 설치한다. $ sudo certbot
=== renew ===
만료예정인 이전에 발급받은 모든 인증서를 갱신한다.(설정파일에 저장된 /etc/...)
=== certificates ===
발급받은 인증서 본다.
 
=== delete ===
인증서를 삭제한다.
 
== Flag ==
 
=== --manual ===
사용자 확인하거나 쉘 스크립트로 인증서를 발급받는다.
=에러=
===와일드카드(*.example.com) 플러그인 에러===
다음 명령으로 수동으로 실행해줘야 한다.
$ sudo certbot certonly --manual --preferred-challenges dns-01 --server <nowiki>https://acme-v02.api.letsencrypt.org/directory</nowiki> -d *.example.com
명령 수행중에 다음과 같은 메시지가 나오는데,
DNS레코드는 바로 갱신되지 않으므로 [[host]]명령으로 DNS가 갱신되었는지 확인하여야 한다.
 
 
=====갱신완료 메시지=====
다음과 같은 메시지가 나왔다면 성공적으로 갱신된 것이다.
https://www.ssllabs.com/ssltest/
 [[분류:SslSSL]]
편집
2,431