
Let’s encrypt는
2026년부터 도메인이 아닌 공인ip 주소에 대해서도 단명 인증서를 발급합니다.
IP인증서는 shortlived 프로필을 사용해야 하며 유효기간은 **160시간(6일 16시간)**입니다.
개인키가 탈취되더라도 유효기간이 매우 짧아 공격자가 인증서를 악용할 수 있는 시간이 크게 줄어들고, 불안정한 인증서 폐기(CRL/OCSP) 시스템에 의존하지 않아도 되며, 갱신 주기가 짧아 자동화 파이프라인의 오류를 즉시 발견해 운영 신뢰성을 높일 수 있습니다.
1. [Certbot 설치]
# snap install --classic certbot # /snap/bin/certbot --version certbot 5.10.0
2. [인증서 발급을 위한 HTTP 검증]
Apache의 기본 DocumentRoot가 /var/www/html인 경우 다음 명령을 실행합니다.
# apache2ctl -S # mkdir -p /var/www/html/.well-known/acme-challenge # echo "acme-test" | sudo tee /var/www/html/.well-known/acme-challenge/test.txt
외부에서 다음 주소에 접근할 수 있는지 웹브라우저에서 접근해 확인합니다.
http://x.x.x.x/.well–known/acme–challenge/test.txt
3. [Let’s Encrypt IP 인증서 발급테스트]
# /snap/bin/certbot certonly --dry-run \ --webroot \ --webroot-path /var/www/html \ --preferred-profile shortlived \ --ip-address x.x.x.x
** Let’s encrypt의 경우 실제 발급 시도시 호스트명당 시간당 5회 시도 가능하며 갱신 시도 횟수 잠금은 1시간 후 초기화 되기때문에 dry–run 옵션을 통해 테스트
|
옵션 |
설명 |
|
certonly |
인증서만 발급하고 웹서버 설정은 변경하지 않음 |
|
–dry-run |
운영용 인증서를 저장하지 않고 발급 절차 테스트 |
|
–webroot |
실행 중인 Apache를 사용해 HTTP 인증 수행 |
|
–webroot-path |
Apache가 제공하는 웹 문서 경로 |
|
–preferred-profile shortlived |
단기 유효기간 인증서 요청 |
|
–ip-address |
인증서에 등록할 공인 IP |
4. [실제 인증서 발급]
# /snap/bin/certbot certonly \ --webroot \ --webroot-path /var/www/html \ --preferred-profile shortlived \ --ip-address x.x.x.x
/etc/letsencrypt/live/x.x.x.x/fullchain.pem /etc/letsencrypt/live/x.x.x.x/privkey.pem
5. [Apache HTTPS 설정]
인증서 발급이 완료되었으면 Apache에서 사용할 수 있도록 SSL 모듈을 활성화합니다.
# a2enmod ssl
IP 전용 HTTPS VirtualHost 설정 파일을 생성합니다.
# vi /etc/apache2/sites-available/ip-ssl.conf
<VirtualHost *:443>
ServerName x.x.x.x
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/x.x.x.x/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/x.x.x.x/privkey.pem
ErrorLog ${APACHE_LOG_DIR}/ip-ssl-error.log
CustomLog ${APACHE_LOG_DIR}/ip-ssl-access.log combined
</VirtualHost>
저장한 다음 사이트를 활성화합니다.
# a2ensite ip-ssl.conf
# apache2ctl configtest
# systemctl reload apache2
6. [인증서 정상 적용 확인]
브라우저에서 다음 주소로 접속(ex. https://x.x.x.x) 하여 확인 후
HTTPS 연결 상태와 인증서의 유효기간과 SAN(Subject Alternative Name)을 확인합니다.
# curl -Iv https://x.x.x.x # vi openssl x509 \ -in /etc/letsencrypt/live/x.x.x.x/cert.pem \ -noout -dates -ext subjectAltName * notBefore: 인증서 유효기간 시작 시각 * notAfter: 인증서 만료 시각 * subjectAltName: IP Address:115.68.248.128 등록 여부





