본문 바로가기
Programming/개발 공부

Https 개발 환경 세팅

by 오늘 하루s 2024. 6. 10.
728x90

 

1. 개발용 SSL 인증서 설정하기

https://slproweb.com/products/Win32OpenSSL.html

 

Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions

Minimum system requirements: Windows XP or later 32MB RAM 200MHz CPU 30MB hard drive space Recommended system requirements: Windows XP or later 128MB RAM 500MHz CPU 300MB hard drive space April 11, 2024 - OpenSSL 3.3 is available. Users should currently in

slproweb.com

 

Win64 OpenSSL EXE버전 다운로드

 

 

 

 

2. 환경변수에 등록

 

시스템 속성 - 고급 - 환경변수 - 시스템 변수 - 새 사용자 변수 추가

 

 

환경변수 - 시스템변수 - Path 추가

 

 

3. 루트키 생성

- 지금부터 관리자 모드로 실행한 cmd에서 진행

- 관리자 모드로 실행시 System32 디렉토리에 있을 경우 빠져나와서 진행

openssl ecparam -out root.key -name prime256v1 -genkey

 

 

4. 루트 인증서 생성

openssl req -new -sha256 -key root.key -out root.csr

 

 

5. 자체서명

openssl x509 -req -sha256 -days 36500 -in root.csr -signkey root.key -out root.crt

 

 

6. 실제 사용할 인증키 생성

openssl ecparam -out test.key -name prime256v1 -genkey

 

 

7. csr에 사용할 config 파일 생성

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no

[req_distinguished_name]
C   = KR
ST  = Korea
L   = Seoul
O   = (직접 입력)
OU  = Solution
CN  = (직접 입력)

[v3_req]
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost
DNS.2 = *.test.com
IP.1 = 127.0.0.1
IP.2 = IP주소입력

 

다음 내용을 포함한 test.conf 파일을 루트 인증서가 생성된 곳에 만들기

 

* (직접 입력) 부분에 저는 회사 이름을 넣었습니다.

 

 

8. 실제 사용할 인증서의 CSR 생성

openssl req -new -sha256 -key test.key -out test.csr -config ./conf/test.conf

 

 

9. CSR 및 키를 사용하여 인증서를 생성하고 CA의 루트 키로 서명

openssl x509 -req -in test.csr -CA  root.crt -CAkey root.key -CAcreateserial -out test.crt -days 3650 -sha256  -extfile ./conf/test.conf -extensions v3_req

 

 

10. pfx로 생성 (비밀번호 없이 생성)

openssl pkcs12 -export -out test.pfx -inkey test.key -in test.crt -certfile root.crt -passout pass:

 

 

 

11. 사설 인증서 OS에 등록하기

test.pfx 실행

 

 

 

 

 

 

 

test.crt 열어서 확인

 

 

12. p12 인증서 생성

openssl pkcs12 -export -out test.p12 -inkey test.key -in test.crt -certfile test.crt -name 이름지정

 

 

13. 다음과 같이 진행 시 생기는 폴더

 

 

14. test.p12 → springboot 프로젝트 복사/붙여넣기

 

 

728x90

'Programming > 개발 공부' 카테고리의 다른 글

[ngrok] local 서버 외부 공유하기  (0) 2024.07.23
MyBatis와 JPA 차이 및 JPA 사용 이유  (0) 2024.06.18
Http Only Cookies  (0) 2024.06.12
REST API  (1) 2023.12.30
윈도우10에 WSL로 리눅스 설치하기  (0) 2023.12.20