무료 인증서 (SSL) 발급 서비스 (LetsEncrypt) 간단 셋팅하기
사이트
특징
|
자가 서명 인증서 (무료)
인증서 유효기간은 90일 (30일 미만 남았을때 부터 인증서 갱신 가능)
*.domain 일괄 서브 도메인 등록 불가 (서브 도메인 하나씩 인증서 발급)
certbot 이라는 스크립트 이용하여 인증서 자동 생성, 갱신 가능
|
테스트 환경
|
도메인 : test.kensei.co.kr
Centos 7 64bit
httpd, mod_ssl (RPM)
|
EPEL 저장소 추가
certbot 설치
웹서버가 Apache 인 경우
|
yum install python2-certbot-apache
|
웹서버가 nginx 인 경우
|
yum install python2-certbot-nginx
|
[사전 작업 필요]
|
SSL 모듈 설치 필요 (mod_ssl)
1. 발급받을 도메인이 certbot을 실행하는 서버 아이피를 바라보고 있어야 함
2. SSL 설정이 되어 있어야 함
|
1번 예시) test.kensei.co.kr 이라는 도메인을 네임서버에서 certbot 을 설치한 웹 서버로 잡아준다.
2번 예시)
/etc/httpd/conf.d/ssl.conf (파일에 도메인 설정이 되어 있어야 함)
|
ServerName test.kensei.co.kr:443
|
위 2가지 작업이 미리 진행되어야 아래와 같이 에러 없이 잘 실행된다.
certbot 명령어 실행 (apache 에서 실행해보았다)
|
[root@iwinvhelper-8053 wordpress]# certbot –apache -m takakocap@naver.com -d test.kensei.co.kr -n –agree-tos Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Cert not yet due for renewal Keeping the existing certificate Deploying Certificate for test.kensei.co.kr to VirtualHost /etc/httpd/conf.d/ssl.conf
——————————————————————————- Congratulations! You have successfully enabled https://test.kensei.co.kr
You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=test.kensei.co.kr ——————————————————————————-
IMPORTANT NOTES: – Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/test.kensei.co.kr/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/test.kensei.co.kr/privkey.pem Your cert will expire on 2017-12-19. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the “certonly” option. 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
|
/etc/httpd/conf.d/ssl.conf (아래 라인이 추가되었다)
|
SSLCertificateFile /etc/letsencrypt/live/test.kensei.co.kr/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/test.kensei.co.kr/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/test.kensei.co.kr/chain.pem
ServerAlias test.kensei.co.kr
|
nginx 에서도 아래와 같이 하면 ssl.conf 파일안에 자동으로 설정까지 끝난다.
|
[root@iwinvhelper-7795 etc]# certbot –nginx -m takakocap@naver.com -d cert.kensei.co.kr -n –agree-tos Saving debug log to /var/log/letsencrypt/letsencrypt.log Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Obtaining a new certificate Performing the following challenges: tls-sni-01 challenge for cert.kensei.co.kr Waiting for verification… Cleaning up challenges Deployed Certificate to VirtualHost /etc/ngi 설치nx/nginx.conf for set([‘cert.kensei.
——————————————————————————- Congratulations! You have successfully enabled https://cert.kensei.co.kr
You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=cert.kensei.co.kr ——————————————————————————-
IMPORTANT NOTES: – Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/cert.kensei.co.kr/fullchain.pem. Your cert will expire on 2017-12-06. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the “certonly” option. 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
|
인증서 갱신 명령어 (crontab 에 추가해서 자동으로 돌려주면 된다)
간단하게 SSL 인증서 다운로드, 설치, 설정까지 한번에 해결된다.