태그 보관물: SSL

DNS TXT Record 로 Let’s Encrypt SSL 인증서 발급 받기

TXT 레코드 요청

  1. certbot 을 실행할 때 –manual 옵션과 –preferred-challenges dns 을 주어서 실행합니다.
    certbot certonly -d new.lesstif.com --manual --preferred-challenges dns
  2. IP 로깅을 허용하겠냐고 묻는 화면에서 Y 를 입력합니다.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NOTE: The IP of this machine will be publicly logged as having requested this
    certificate. If you're running certbot in manual mode on a machine that is not
    your server, please ensure you're okay with that.
    
    Are you OK with your IP being logged?
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    (Y)es/(N)o: Y
  3. TXT 에 등록할 내용이 출력되면 복사해 둡니다.
    Please deploy a DNS TXT record under the name
    _acme-challenge.new.lesstif.com with the following value:
    
    slqQSBrs4rToROM7LyEeBVvI92YXi3JJ-RK6S5OBKNc
    
    Before continuing, verify the record is deployed.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Press Enter to Continue
  4.  DNS 서버에 TXT 레코드를 등록합니다. DNS 서비스 제공자에 따라 화면이 다를 수 있습니다.
  5. 새로운 터미널을 열고 정상적으로 등록됐는지 확인합니다.
    $ nslookup -q=TXT _acme-challenge.new.lesstif.com
    
    
    Server:         168.126.63.1
    Address:        168.126.63.1#53
    
    Non-authoritative answer:
    _acme-challenge.new.lesstif.com text = "slqQSBrs4rToROM7LyEeBVvI92YXi3JJ-RK6S5OBKNc"
    
    Authoritative answers can be found from:
  6. 기존 let’s encrypt 발급 터미널로 간 후에 엔터를 입력합니다.
  7. 정상 발급되었는지 확인하고 웹 서버를 설정합니다.
    Waiting for verification...
    Cleaning up challenges
    
    IMPORTANT NOTES:
     - Congratulations! Your certificate and chain have been saved at:
       /etc/letsencrypt/live/new.lesstif.com/fullchain.pem
       Your key file has been saved at:
       /etc/letsencrypt/live/new.lesstif.com/privkey.pem

Tomcat 서버 HTTPS / SSL 적용

1. .keystore 파일 경로를 원하는 위치에 이동시킨다!!!

2. Tomcat 서버의 server.xml을 연다 .  (보통은 톰캣위치\conf 경로에 존재한다. )

server.xml을 열어보자!

3. 아래의 소스코드를 추가한다.

HTTPS통신을 할 포트번호를 정한다 ( https는 Port 443이 기본이다.  혹시 기존에 해당 포트가 사용중이라면 , 다른포트를 이용하자)

keystorepass에는 키스토어 비밀번호를 입력한다.

keystorefile에는 .keystore의 위치를 지정해준다.

1
2
3
4
5
<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol"
SSLEnabled="true" URIEncoding="euc-KR" maxThreads="150" scheme="https"
secure="true" ciphers="TLS_RSA_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA"
keystoreFile="D:/Workspace/PLMS/PLAN_PLM/cert/certification/STAR.hankooktech.com.jks"
keystorePass="hankooktire" clientAuth="false" sslProtocol="TLS"/>