Skip to content

Latest commit

ย 

History

History
88 lines (56 loc) ยท 1.86 KB

SSL์ ์šฉ.md

File metadata and controls

88 lines (56 loc) ยท 1.86 KB

SSL ์ ์šฉ

https://certbot.eff.org/instructions?ws=other&os=ubuntufocal ์—์„œ

๋ณธ์ธ์—๊ฒŒ ๋งž๋Š” SofWare์™€ os๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  • software : spring boot๊ฐ€ ์—†์–ด์„œ other๋กœ ์„ ํƒ
  • os : Ubuntu 20

image

  1. WAS ์„œ๋ฒ„์— ์ ‘์†ํ•œ๋‹ค.

  2. snap์„ ์„ค์น˜ ๋ฐ ์ตœ์‹  ๋ฒ„์ „ ํ™•์ธ

    (https://snapcraft.io/docs/snapcraft-overview)

    sudo snap install snapcraft --classic
    sudo snap install core; sudo snap refresh core
  3. ๊ธฐ์กด certbot ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์‚ญ์ œ

    sudo apt-get remove certbot
  4. certbot ์„ค์น˜

    sudo snap install --classic certbot
    
  5. ๋„๋ฉ”์ธ - IP ๋งตํ•‘์„ ํ™•์ธํ•œ๋‹ค.

    nslookup dev-brave-people.o-r.kr
    
  6. ์ƒํ™ฉ์— ๋งž๊ฒŒ certbot ์‹คํ–‰

    ์ผ๋‹จ, 80, 443 ๋„๋Š”์ง€ ํ™•์ธ

    sudo netstat -lntp | grep 80
    sudo netstat -lntp | grep 443
    • ์›น ์„œ๋ฒ„ ์ค‘์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ์ค‘์ง€๋ฅผ ํ•˜๊ณ  ์•„๋ž˜ ๋ช…๋ น์–ด

      sudo certbot certonly --standalone -d dev-brave-people.o-r.kr
    • ์›น ์„œ๋ฒ„ ์ค‘์ง€ ๋ชปํ•  ๊ฒฝ์šฐ ์•„๋ž˜ ๋ช…๋ น์–ด

      sudo certbot certonly --webroot
  7. ์ธ์ฆ์„œ ํ™•์ธ

    sudo certbot certificates sudo letsencrypt certonly --standalone -d dev-brave-people.o-r.kr
  8. spring boot๋Š” JKS ๋˜๋Š” PCKS12 ์ธ์ฆ์„œ๊ฐ€ ํ•„์š”. (openssl ๋ช…๋ น์–ด๋กœ PCKS12 ํ‚ค๋ฅผ ์ƒ์„ฑ)

    openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out keystore.p12 -name ttp -CAfile chain.pem -caname root
  9. application.yml ์— ์ •๋ณด ์ถ”๊ฐ€

    server:
      port: 443
      ssl:
        key-store: ${pemkey.path} #p12key ํŒŒ์ผ ์œ„์น˜
        key-store-type: PKCS12
        key-store-password: ${ssl.password} #ํ‚ค ์ƒ์„ฑ์‹œ ์ž…๋ ฅํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ