설명은 offbyone.tistory.com/275 여기가 제일 잘되어 있는 것 같다. 해당 내용을 참조해서 작성 됨.
추후 해당 글이 없어질 염려가 있으므로 정리해본다.
헷갈릴수 있으므로 비밀번호는 무조건 123456으로 통일
openssl 압축 풀고 bin 폴더에서 아래 명령어 실행
1. 설치 : https://code.google.com/archive/p/openssl-for-windows/downloads
2. openssl genrsa -aes256 -out rootca_private.key 2048
3. openssl req -new -key rootca_private.key -out rootca.csr -config ../openssl.cnf
- A challenge password, An optional company name은 그냥 엔터
4. openssl x509 -req -days 3650 -extensions v3_ca -set_serial 1 -in rootca.csr -signkey rootca_private.key -out rootca.crt
5. openssl genrsa -aes256 -out localhost_private.key 2048
6. openssl req -new -key localhost_private.key -out localhost.csr -config ../openssl.cnf
- Common Name에 정확한 도메인명 입력 (ex. localhost or local.seongsland.com)
- A challenge password, An optional company name은 그냥 엔터
7. openssl x509 -req -days 3650 -extensions v3_user -in localhost.csr -CA rootca.crt -CAcreateserial -CAkey rootca_private.key -out localhost.crt
8. openssl pkcs12 -export -in localhost.crt -inkey localhost_private.key -out keystore -name "localhost cert"
9. 해당 폴더에 "keystore" 파일 tomcat 설정에 추가
- <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" scheme="https" secure="true" keystoreFile="D:/cert/keystore" keystorePass="123456" clientAuth="false" sslProtocol="TLS" />
10. root 인증서 설치
- 해당 폴더에서 rootca.crt 파일 실행
- 인증서 설치 > 현재 사용자 > 모든 인증서를 다음 저장소에 저장 > 신뢰할 수 있는 루트 인증 기관 > 마침
위의 순서대로 진행 시 IE에서는 문제 없는 인증서로 처리 되지만 chrome의 경우에는 유효하지 않은 인증서로 처리 된다.
그러나 개발할 때 문제는 없는것 같다.
'Java' 카테고리의 다른 글
null 처리에 대한 코딩 방식 (1) | 2022.07.15 |
---|---|
java Object deep clone 비교 (0) | 2022.06.29 |
RSA 암호화 java 구현 class (0) | 2018.02.23 |
goo.gl api java 구현 (0) | 2016.10.06 |
bit.ly api java 구현 (0) | 2016.10.06 |