노트북으로 홈서버 구축하기 - certbot --expand로 SSL 서브도메인 추가하기 (9편)

문제 상황 처음 SSL 인증서를 발급할 때 메인 도메인만 포함해서 발급했다. certbot certonly --nginx -d yourdomain.com 이후 서비스가 하나씩 늘어나면서 서브도메인이 추가됐는데, 브라우저에서 photo.yourdomain.com에 접속하면 아래 에러가 발생했다. NET::ERR_CERT_COMMON_NAME_INVALID 연결이 비공개로 설정되어 있지 않습니다. 인증서에 photo.yourdomain.com이 포함돼 있지 않아서 생기는 문제였다. 해결: –expand 옵션 기존 인증서에 서브도메인을 추가할 때는 --expand 플래그를 써야 한다. --expand 없이 서브도메인을 추가하려고 하면 아래 에러가 난다. Missing command line flag or config entry for this setting: You have an existing certificate that contains a portion of the domains you requested. It contains these names: yourdomain.com You requested these names for the new certificate: yourdomain.com, photo.yourdomain.com Do you want to expand and replace this existing certificate with the new certificate? (You can set this with the --expand flag) certbot이 친절하게 --expand 쓰라고 안내해주긴 한다. ...

March 31, 2026 · 2 min · 363 words · Chanyeol

Tomcat HTTPS(SSL/TLS) 적용 가이드: JKS와 P12 설정 및 자동 리다이렉트

서론 웹 서비스의 보안(HTTPS)은 이제 선택이 아닌 필수입니다. Tomcat에서 SSL 인증서를 적용하는 방법은 인증서 형식(JKS, PKCS12 등)에 따라 설정 방식이 조금씩 다릅니다. 이번 포스팅에서는 인증서 적용부터 HTTP 요청을 HTTPS로 강제 전환하는 방법까지 정리합니다. 1. SSL 인증서 적용 (server.xml) 최신 Tomcat 버전에서는 .p12(PKCS12) 형식을 권장합니다. server.xml의 <Connector> 부분을 다음과 같이 설정합니다. <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="conf/certificate.p12" certificateKeystorePassword="your_password" type="RSA" /> </SSLHostConfig> </Connector> 2. HTTP to HTTPS 자동 리다이렉트 사용자가 http://로 접속해도 자동으로 https://로 전환되도록 설정해야 합니다. ...

February 23, 2026 · 1 min · 200 words · Chanyeol
1