1. keystore 파일 pcks12 형식으로 변환
-
[tmax@Test-server:/app/tmax/webtob/ssl/test]keytool -importkeystore -srcstoretype JKS -srckeystore ssl.keystore -deststoretype PKCS12 -destkeystore ssl.pk12.key
대상 키 저장소 비밀번호 입력:
새 비밀번호 다시 입력:
소스 키 저장소 비밀번호 입력:
hbss.lh.or.kr 별칭에 대한 항목이 성공적으로 임포트되었습니다.
임포트 명령 완료: 성공적으로 임포트된 항목은 1개, 실패하거나 취소된 항목은 0개입니다.
[tmax@Test-server:/app/tmax/webtob/ssl/test]ll
total 31
drwx------ 6 tmax staff 9 12월 8일 15:35 ..
-rw-r--r-- 1 tmax staff 5356 12월 8일 15:36 ssl.keystore
drwxr-xr-x 2 tmax staff 4 12월 8일 15:39 .
-rw-r--r-- 1 tmax staff 6090 12월 8일 15:39 ssl.pk12.key # pk12 파일 생성
2. openssl 로 사용자가 확인할 수 있는 형식으로 다시 변환
[tmax@Test-server:/app/tmax/webtob/ssl/test]openssl pkcs12 -in ssl.pk12.key -nodes -out ssl.pem
Enter Import Password:
MAC verified OK
[tmax@Test-server:/app/tmax/webtob/ssl/test]ll
total 48
drwx------ 6 tmax staff 9 12월 8일 15:35 ..
-rw-r--r-- 1 tmax staff 5356 12월 8일 15:36 ssl.keystore
-rw-r--r-- 1 tmax staff 6090 12월 8일 15:39 ssl.pk12.key
drwxr-xr-x 2 tmax staff 5 12월 8일 15:50 .
-rw-r--r-- 1 tmax staff 8122 12월 8일 15:50 ssl.pem
3. openssl 로 인증서 분리
[tmax@Test-server:/app/tmax/webtob/ssl/test]openssl pkcs12 -in ssl.pk12.key -nokeys -out ssl.pk12.crt
Enter Import Password:
MAC verified OK
[tmax@Test-server:/app/tmax/webtob/ssl/test]ll
total 62
drwx------ 6 tmax staff 9 12월 8일 15:35 ..
-rw-r--r-- 1 tmax staff 5356 12월 8일 15:36 ssl.keystore
-rw-r--r-- 1 tmax staff 6090 12월 8일 15:39 ssl.pk12.key
-rw-r--r-- 1 tmax staff 8122 12월 8일 15:50 ssl.pem
drwxr-xr-x 2 tmax staff 6 12월 8일 15:51 .
-rw-r--r-- 1 tmax staff 6268 12월 8일 15:51 ssl.pk12.crt
4. openssl 로 개인키 분리
[tmax@Test-server:/app/tmax/webtob/ssl/test]openssl pkcs12 -in ssl.pk12.key -nocerts -out ssl.key
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
[tmax@Test-server:/app/tmax/webtob/ssl/test]ll
total 63
drwx------ 6 tmax staff 9 12월 8일 15:35 ..
-rw-r--r-- 1 tmax staff 5356 12월 8일 15:36 ssl.keystore
-rw-r--r-- 1 tmax staff 6090 12월 8일 15:39 ssl.pk12.key
-rw-r--r-- 1 tmax staff 8122 12월 8일 15:50 ssl.pem
-rw-r--r-- 1 tmax staff 6268 12월 8일 15:51 ssl.pk12.crt
drwxr-xr-x 2 tmax staff 7 12월 8일 15:52 .
-rw-r--r-- 1 tmax staff 1984 12월 8일 15:52 ssl.key
현재 생성한 파일
ssl.pk1.key : pkcs12(개인정보교환표준) 형식으로 인증서 정보를 추출하기 위한 파일.
ssl.pem : Base64인코딩된 ASCII text file - 인증서, 개인키 등이 모두 들어있음. (실제 인증서 설정에 사용하지 않을거임)
ssl.pk12.crt : ssl.pk1.key 에서 인증서 부분만 추출한 파일.
ssl.key : ssl.pk1.key 에서 개인키 부분만 추출한 파일
5. WebtoB 실행시 인증서 비밀번호 자동입력할 shell 파일
[tmax@Test-server:/app/tmax/webtob/ssl/test]vi pass.sh
-------------------- pass.sh 본문 내용 중 --------------------
#!/bin/sh
echo password123 # 비밀번호 입력
6. http.m 설정
[tmax@Test-server:/app/tmax/webtob/config]vi http.m
-------------------- http.m 본문 내용 중 --------------------
*SSL
ssl CertificateFile = "/app/tmax/webtob/ssl/opendata/ssl.crt", # 인증서
CertificateKeyFile = "/app/tmax/webtob/ssl/opendata/ssl.key", # 개인키
CertificateChainFile = "/app/tmax/webtob/ssl/opendata/ssl.crt", # 체인키
PassPhraseDialog="exec:/app/tmax/webtob/ssl/opendata/pass.sh" # WebTobe 실행시 비밀번호 자동 입력
7. http.m 컴파일 후 WebToB 재시작
# http.m 컴파일
[tmax@Test-server:/app/tmax/webtob/config]wscfl -i http.m
CFL0560: Configuration uses SSL/TLS.
CFL0368: Configuration uses privileged listen ports (those below 1024). These ports generally require root privilege. The user may run WebtoB as a superuser, or change the owner of htl to root and enable the setuid (sticky) bit on htl.
Current configuration:
Number of client handler(HTH) = 1
Supported maximum user per node = 8013
Supported maximum user per handler = 8013
Successfully created the configuration file (/app/tmax/webtob/config/wsconfig) for node Test-server.
The host name of the running machine is Test-server.
#http.m WebToBe 재시작
[tmax@Test-server:/app/tmax/webtob/bin]wsdown
Do you really want to shut down WebtoB? (y : n): y
WSDOWN for node(Test-server) is starting:
WSDOWN: SERVER(html:0) downed: Wed Dec 08 16:11:06 2021
WSDOWN: SERVER(html:1) downed: Wed Dec 08 16:11:06 2021
WSDOWN: HTL downed: Wed Dec 08 16:11:07 2021
WSDOWN: HTH downed: Wed Dec 08 16:11:07 2021
WSDOWN: WSM downed: Wed Dec 08 16:11:07 2021
WSDOWN: WebtoB is down
[tmax@Test-server:/app/tmax/webtob/bin]wsboot
Booting WebtoB on node (Test-server)
Starting WSM at Wed Dec 08 16:11:08 2021
Starting HTL at Wed Dec 08 16:11:08 2021
Starting HTH at Wed Dec 08 16:11:08 2021
Current WebtoB Configuration:
Number of client handlers (HTH) = 1
Supported maximum user per node = 8013
Supported maximum user per handler = 8013
Starting SVR(htmls) at Wed Dec 08 16:11:08 2021
댓글