본문 바로가기

카테고리 없음

SpringBoot SSL 사용법

keytool -genkeypair -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore keystore.p12 -validity 365 -storepass test12!@ -keypass test12!@ -dname "CN=test, OU=test, O=test, L=Seoul, S=Seoul, C=Korea" -alias bns-ssl

먼저

  1. 위의 명령어로 keystore 생성 keystore.p12 파일을 Spring Boot프로젝트 루트에 복사해 넣는다
  2. application.yaml 파일에 아래와 같이 추가한다.
    server:
    port: 8080
    ssl:
    enabled: true
    key-store: keystore.p12
    key-store-password: test12!@
    key-store-type: PKCS12
    key-alias: bns-ssl

https://localhost:8080으로 접근