본문 바로가기
MiddleWare/Apache, Tomcat

Tomcat SSL HTTPS 설정 (JKS, PFX, APR)

by hnrupangit 2022. 8. 24.
Tomcat SSL HTTPS

 

 

JKS(Java Key Store) : SSL 암호화를 위해 쓰이는 key 들을 모아놓은 파일

두 가지 핵심 요소 암호 알고리즘과 암호키

암호키는 Java가 제공하는 KeyStore에 저장되도록 되어 있음

Keytool : Keystore 기반으로 인증서와 키를 관리할 수 있는 커맨드 방식의 유틸리티로 JDK에 포함되어 있음. 커맨드 방식의 openssl과 비슷한 용도로 사용가능

- JKS(Java KeyStore) : 확장자 .jks

- JCEKS(Java Cryptography Extensions Keystore) : 확장자 .jck

- PKCS12(Public Key Cryptography Standards #12) : 확장자 .p12

세 파일 양식 모두 PBE(Password-Based Encryption) 방식을 사용

사용자가 입력한 Password로 암호키를 파생(derive)하고, 파생된 암호키로 Private-key를 암호화시켜 keystore파일안에 저장

Keytool로 인증서 확인
[root@localhost ssl]# keytool -list -keystore jsp4.xinet.kr.jks
저장소 비밀번호 입력: 123456
저장소 유형: jks
저장소 제공자: SUN
 
저장소에 1개의 항목이 포함되어 있습니다.
 
1, 2018. 11. 30, PrivateKeyEntry,
인증서 지문(SHA1): C5:8C:FC:2B:28:B2:85:C6:0A:D6:3C:19:34:29:91:81:FE:0A:12:80

Server.xml - JavaKeyStore (jks)
<Connector
port="443" scheme="https" secure="true" SSLEnabled="true"
keystoreFile="인증서경로/sslcert.co.kr_xxxxx.jks 파일" keystorePass=".jks 패스워드"
sslProtocol="TLS"
/>
(참고)
<!-- JKS SSL Password True / HTTP/1.1 / https-openssl-nio protocol -->
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxHttpHeaderSize="8192" maxThreads="150"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true"
SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
keystoreFile="/usr/local/tomcat/conf/ssl/******.jks"
keystorePass="123456"
/>

Server.xml - PFX
<Connector
port="443" SSLEnabled="true"
scheme="https" secure="true" sslProtocol="TLS"
keystoreFile="인증서경로/sslcert.co.kr_xxxxx.pfx" keystorePass="pfx암호" keystoreType="PKCS12"
/>

Server.xml - ARP
<Connector
port="443" SSLEnabled="true"
scheme="https" secure="true" SSLProtocol="TLSv1.2"
SSLPassword="개인키 암호" (*CSR 수동 생성시에 설정 또는 인증서 변환 매뉴얼 참조)
SSLCertificateKeyFile=/인증서파일경로/개인키 ex. sslcert.co.kr_xxxxx.key.pem
SSLCertificateFile=/인증서파일경로/서버인증서 ex. sslcert.co.kr_xxxxx.crt.pem
SSLCertificateChainFile=/인증서파일경로/체인인증서ex. chain-bundle.pem
SSLCACertificateFile=/인증서파일경로/루트인증서 ex. AAACertificateServicesRoot.crt.pem
/>

댓글