1. Keystore 생성 방법
1) keystore 생성
keytool -genkey -v -keystore server -alias server -keyalg RSA -keysize 2048 -validity 10000
keytool -genkey -v -keystore client -alias client -keyalg RSA -keysize 2048 -validity 10000
2) truststore 생성
keytool -export -alias server -keystore server -rfc -file trustServer.cer
keytool -export -alias client -keystore client -rfc -file trustClient.cer
3) cacerts 파일에 keystore추가
이때 cacerts는 C:\Program Files\Java\jre1.8.0_261\lib\security 아래 경로에 저장하도록 한다.
keytool -import -alias trustServer -file trustServer.cer -keystore cacerts –storepass changeit
keytool -import -alias trustClient -file trustClient.cer -keystore cacerts –storepass changeit
2. Camel https ssl 적용 방법
1) route 설정
route 뒤에 'ssl=true&sslContextParameters=#sslContextParameters'를 추가해준다.
<route id="server" autoStartup="true" shutdownRunningTask="CompleteAllTasks">
<from uri="netty4-http:http://127.0.0.1:8084/analyzer?matchOnUriPrefix=true&reuseChannel=true&mapHeaders=false&ssl=true&sslContextParameters=#sslContextParameters" />
2) sslContextParameters 설정
sslContextParameters에 아까 생성한 key
<sslContextParameters id="sslContextParameters" xmlns="http://camel.apache.org/schema/spring">
<keyManagers keyPassword="123456">
<keyStore resource="C:\Program Files\Java\jdk1.8.0_261\bin\server" password="123456" />
</keyManagers>
</sslContextParameters>
'WEB' 카테고리의 다른 글
Postman 테스트 시, WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc 발생 (0) | 2020.10.15 |
---|---|
HTTPS 테스트 시 javax.net.ssl.SSLHandshakeException: No available authentication scheme 에러 발생 (0) | 2020.10.13 |
CSS Selector (0) | 2020.06.28 |
HTML5 - WebSockets (0) | 2020.06.28 |
jQuery Event Methods (0) | 2020.06.28 |