๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Spring/Spring Security

http ์—์„œ https๋กœ ์ „ํ™˜ํ•˜๊ธฐ

๐Ÿ—ฏ๏ธ ๋ฌธ์ œ


๊ธฐ์กด ์„ค๊ณ„์—์„œ https

์„ค๊ณ„ ๋‹จ๊ณ„์—์„œ๋Š” https์˜ ๋„์ž…์€ ๊ณ ๋ คํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

๊ทธ ์ด์œ ๋Š” security์— ๋Œ€ํ•œ ์ˆ™๋ จ๋„๊ฐ€ ๋‚ฎ๊ณ  ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ์— ์ข€๋” ์ง‘์ค‘ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— https ์„ค์ •์„ ํ•˜์ง€ ์•Š์•„๋„ ๊ธฐ๋ณธ์ ์ธ ๊ธฐ๋Šฅ์ด ์ˆ˜ํ–‰๋  ๊ฒƒ์ด๋ผ ์ƒ๊ฐํ–ˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

 

https๋กœ์˜ ์ „ํ™˜ ์ด์œ ?

https๋กœ ์ „ํ™˜ํ•˜๊ธฐ๋กœ ํ•œ ์ด์œ ๋Š” 2๊ฐ€์ง€์ž…๋‹ˆ๋‹ค. ๋ณด์•ˆ ์ด์Šˆ์™€ Mixed content ์ด์Šˆ ์ž…๋‹ˆ๋‹ค.

 

1. ๋ณด์•ˆ ์ด์Šˆ

ํ˜„์žฌ ๊ฐœ๋ฐœ ๋‹จ๊ณ„์—์„œ๋Š” ์™ธ๋ถ€์— ํŽ˜์ด์ง€๋ฅผ ๊ฐœ๋ฐฉํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์ง€๋งŒ, ๋‚˜์ค‘์„ ์ƒ๊ฐํ•˜๋ฉด https์˜ ๋„์ž…์„ ํ•„์ˆ˜๋กœ ํ•ด์•ผํ•œ๋‹ค๋Š” ๋ฉ˜ํ† ๋‹˜์˜ ์กฐ์–ธ์ด ์žˆ์–ด์„œ ๋„์ž…์„ ๊ณ ๋ คํ–ˆ์Šต๋‹ˆ๋‹ค.

2. ํ”„๋ก ํŠธ์˜ Mixed content ์ด์Šˆ

ํ”„๋ก ํŠธ์—”๋“œ ์„œ๋ฒ„์—์„œ https๋กœ ๋ฐฐํฌํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— http๋กœ ๋ฐฐํฌ๋œ ๋ฐฑ์—”๋“œ api ํ˜ธ์ถœ ์‹œ Mixed content ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๊ณ , ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” https๋กœ ๋ฐฑ์—”๋“œ ์„œ๋ฒ„๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. Mixed content๋ž€?

์ด๋Ÿฐ ์ด์œ ๋“ค๋กœ https๋ฅผ ์ ์šฉํ•˜๊ธฐ๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ”ฅ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•


1. ์ธ์ฆ๋˜์ง€ ์•Š์€ SSL ์ธ์ฆ์„œ ๋ฐœ๊ธ‰

์ฒซ๋ฒˆ์งธ๋กœ, ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๋ฐ๋ธŒ์ฝ”์Šค ๊ฐ•์˜ ์ค‘ java์˜ ๊ธฐ๋ณธ ๋ช…๋ น์–ด์ธ keytool์„ ์ด์šฉํ•ด ์ธ์ฆ๋˜์ง€ ์•Š์€ ssl ์ธ์ฆ์„œ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ฐฐ์› ๋Š”๋ฐ, ์ด ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•˜๊ธฐ๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค.

keytool -genkey -alias prgrms_keystore -keyalg RSA -storetype PKCS12 -keystore prgrms_keystore.p12 # keystore ์ƒ์„ฑ
keytool -export -alias prgrms_keystore -keystore prgrms_keystore.p12 -rfc -file prgrms.cer # keystore์—์„œ ์ธ์ฆ์„œ ์ถ”์ถœ
keytool -import -alias prgrms_truststore -file prgrms.cer -keystore prgrms_truststore.p12 # trust-store ์ƒ์„ฑ

ํ•ด๋‹น ๋ฐฉ๋ฒ•์€ ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” ์ธ์ฆ๊ธฐ๊ด€์—์„œ ๋ฐœ๊ธ‰๋ฐ›์€๊ฒƒ์ด ์•„๋‹Œ ์‚ฌ์„ค ์ธ์ฆ์„œ์ด๊ธฐ ๋•Œ๋ฌธ์— ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

2. ์ธ์ฆ๋œ SSL ์ธ์ฆ์„œ ๋ฐœ๊ธ‰

๊ธฐ์กด์˜ ๋ฐฉ๋ฒ•์œผ๋กœ๋Š” ๋ณด์•ˆ ๋ฌธ์ œ๊ฐ€ ์™„์ „ํžˆ ํ•ด๊ฒฐ์ด ๋˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— ์ธ์ฆ๋œ SSL ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰๋ฐ›์•„์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. Let’s Encrypt๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐœ๊ธ‰๋ฐ›์•˜์Šต๋‹ˆ๋‹ค.

 

2-1. ๋„๋ฉ”์ธ ์ฃผ์†Œ ๋ฐœ๊ธ‰

ssl ์ธ์ฆ์„œ ๋ฐœ๊ธ‰์—๋Š” ์„ ํ–‰ ์กฐ๊ฑด์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์„œ๋ฒ„์— ์—ฐ๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋„๋ฉ”์ธ ์ฃผ์†Œ์ž…๋‹ˆ๋‹ค.

๋ณดํ†ต ๋„๋ฉ”์ธ ๋ฐœ๊ธ‰์€ ์œ ๋ฃŒ์ด์ง€๋งŒ, ๋ช‡๋ช‡์˜ ๋ฌด๋ฃŒ ๋„๋ฉ”์ธ ๋ฐœ๊ธ‰ ์‚ฌ์ดํŠธ๋ฅผ ํ†ตํ•ด ์ผ์ • ๊ธฐ๊ฐ„๋™์•ˆ ๋ฌด๋ฃŒ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๋ฌด๋ฃŒ ๋„๋ฉ”์ธ์„ ๋ฐœ๊ธ‰๋ฐ›์•˜์Šต๋‹ˆ๋‹ค.

๋„๋ฉ”์ธ ๋ฐœ๊ธ‰ ์‚ฌ์ดํŠธ

ํ•ด๋‹น ํ™ˆํŽ˜์ด์ง€์˜ ํšŒ์›๊ฐ€์ž… ํ›„ ์›ํ•˜๋Š” ๋„๋ฉ”์ธ์„ ์ž…๋ ฅํ•ด ์ฃผ์†Œ๋ฅผ ํ• ๋‹น๋ฐ›์•˜์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ , ์•„๋ž˜ ๊ทธ๋ฆผ์ฒ˜๋Ÿผ IP์—ฐ๊ฒฐ๋ž€์— ์„œ๋ฒ„์˜ ip์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ด ์„œ๋ฒ„์™€ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

์ž…๋ ฅ์ด ์™„๋ฃŒ๋˜๋ฉด, IP ์ฃผ์†Œ ๋Œ€์‹  ๋„๋ฉ”์ธ ์ฃผ์†Œ ์ž…๋ ฅ์œผ๋กœ ํ•ด๋‹น IP์— ์ ‘์†ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

2-2. Let's Encrypt ์ธ์ฆ์„œ ๋ฐœ๊ธ‰

Let's Encrypt ์ธ์ฆ์„œ ๋ฐœ๊ธ‰์—๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์ง€๋งŒ, ์—ฌ๊ธฐ์„œ๋Š” Certbot์„ ์ด์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

Certbot

[Certbot

Tagline

certbot.eff.org](https://certbot.eff.org/)

# ubuntu์—์„œ certbot ์„ค์น˜
apt install software-properties-common
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt update
apt upgrade
apt install certbot python3-certbot-apache

์ธ์ฆ์„œ ๋ฐœ๊ธ‰์„ ์œ„ํ•ด์„œ๋Š” 3๊ฐ€์ง€์˜ ๊ณผ์ •์„ ๊ฑฐ์นฉ๋‹ˆ๋‹ค.

  1. Certbot ์ธ์ฆ์„œ ์š”์ฒญ
  2. ์š”์ฒญํ•œ ๋„๋ฉ”์ธ ์†Œ์œ ์ฃผ ํ™•์ธ
  3. ์ธ์ฆ์„œ ๋ฐœ๊ธ‰

๊ทธ๋ฆฌ๊ณ , ๋„๋ฉ”์ธ ์†Œ์œ ์ฃผ ํ™•์ธ์„ ์œ„ํ•œ ๋ฐฉ๋ฒ•์—๋Š” 3๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. standalone - ๊ฐ€์ƒ ์›น์„œ๋ฒ„๋ฅผ ๊ฐ€๋™ํ•˜์—ฌ ๋„๋ฉ”์ธ์†Œ์œ ์ฃผ ํ™•์ธ
  2. webroot - ์ž์‹ ์˜ ์›น์„œ๋ฒ„๊ฐ€ ์ œ๊ณตํ•˜๋Š” ํŠน์ • ํŒŒ์ผ๋กœ ๋„๋ฉ”์ธ์†Œ์œ ์ฃผ ํ™•์ธ
  3. dns - dns ๋ ˆ์ฝ”๋“œ์— ํŠน์ • ๊ฐ’์„ ์ž‘์„ฑํ•˜์—ฌ ๋„๋ฉ”์ธ์†Œ์œ ์ฃผ ํ™•์ธ

์—ฌ๊ธฐ์„œ๋Š” ์„œ๋ฒ„๋ฅผ ์ข…๋ฃŒํ•ด๋„ ์•„๋ฌด๋Ÿฐ ๋ฌธ์ œ๊ฐ€ ์—†์—ˆ๊ธฐ ๋•Œ๋ฌธ์— 1๋ฒˆ ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์„œ๋ฒ„๋ฅผ ์ค‘๋‹จํ•  ์ˆ˜ ์—†์„ ๊ฒฝ์šฐ 2๋ฒˆ ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋จผ์ €, ์ธ์ฆ์„œ ๋ฐœ๊ธ‰์— 80๋ฒˆ ํฌํŠธ๊ฐ€ ์‚ฌ์šฉ๋˜๊ธฐ ๋•Œ๋ฌธ์— aws์—์„œ ์ธ๋ฐ”์šด๋“œ ํฌํŠธ๊ฐ€ ์—ด๋ ค์žˆ๋Š”์ง€ ํ™•์ธํ•œ ํ›„ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

# ssl ์ธ์ฆ์„œ ๋ฐœ๊ธ‰
sudo certbot certonly --standalone
[sudo] password for dev:   <root password>
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): **# ์ด๋ฉ”์ผ ์ž…๋ ฅ**

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y **# ์•ฝ๊ด€ ๋™์˜**

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y **# ์ด๋ฉ”์ผ ์ •๋ณด ์ˆ˜์‹  ๋™์˜**
Please enter in your domain name(s) (comma and/or space separated)
(Enter 'c' to cancel): **# ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰ํ•  ๋„๋ฉ”์ธ ์ž…๋ ฅ**
Requesting a certificate for everevent.kro.kr

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/vompressor.com/fullchain.pem **# ๋ฐœ๊ธ‰๋œ ์ธ์ฆ์„œ ๊ฒฝ๋กœ**
   Your key file has been saved at:
   /etc/letsencrypt/live/vompressor.com/privkey.pem **# ๋ฐœ๊ธ‰๋œ ์ธ์ฆ์„œ ๊ฒฝ๋กœ**
   Your certificate will expire on 2021-05-16. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

์ด ์ค‘ ๊ธฐ์–ตํ•  ๋ถ€๋ถ„์€ ๋„๋ฉ”์ธ ์ž…๋ ฅ๊ณผ ์ธ์ฆ์„œ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค.

์œ„์˜ ๋„๋ฉ”์ธ ๋ฐœ๊ธ‰ ์‚ฌ์ดํŠธ์—์„œ ๋ฐœ๊ธ‰๋ฐ›๊ณ , ํ•ด๋‹น aws ์„œ๋ฒ„์™€ ์—ฐ๊ฒฐํ•œ ๋„๋ฉ”์ธ ์ฃผ์†Œ๋ฅผ ์ •ํ™•ํžˆ ์ž…๋ ฅํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ , ํ•ด๋‹น ์ธ์ฆ์„œ ๊ฒฝ๋กœ์— ๊ด€๋ จ ํŒŒ์ผ๋“ค์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

 

2-3. ์ธ์ฆ์„œ๋ฅผ Spring Boot ํ”„๋กœ์ ํŠธ์™€ ์—ฐ๊ฒฐํ•˜๊ธฐ

์ฒ˜์Œ ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰๋ฐ›์œผ๋ฉด /etc/letsencrypt/live ๊ฒฝ๋กœ์— ์ธ์ฆ์„œ ๊ด€๋ จ ํŒŒ์ผ๋“ค์ด ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

ํด๋” ์ ‘๊ทผ์€ root ๊ณ„์ •๋งŒ ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— sudo -s ๋กœ ์ „ํ™˜ ํ›„ ์ ‘๊ทผํ•ฉ๋‹ˆ๋‹ค.

ํด๋”์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฐœ๊ธ‰ํ•œ ๋„๋ฉ”์ธ ์ฃผ์†Œ๋ช…์œผ๋กœ ๋˜์–ด์žˆ๋Š” ํด๋”๊ฐ€ ์ƒ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ๋Š” ์ด๋ฏธ ๋ฐœ๊ธ‰ํ•œ ๋‹ค๋ฅธ ์ธ์ฆ์„œ๋“ค์ด ํฌํ•จ๋˜์–ด์žˆ์ง€๋งŒ, ์ดˆ๊ธฐ์— ์ ‘๊ทผํ•  ์‹œ ๋ฏผํŠธ์ƒ‰์˜ 4๊ฐœ์˜ ํŒŒ์ผ + README๋งŒ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.

ํ•ด๋‹น ํ‚ค๋“ค์˜ ์šฉ๋„๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • privkey.pem : ๊ฐœ์ธํ‚ค
  • fullchain.pem : ๋‚ด ๊ธฐ๋ณธ ๊ณต๊ฐœํ‚ค + ๊ธฐํƒ€ ์ •๋ณด๋ฅผ ํฌํ•จํ•œ ๊ณต๊ฐœ ํ‚ค
  • cert.pem : ๊ธฐ๋ณธ ๊ณต๊ฐœํ‚ค
  • chain.pem : ๊ธฐํƒ€ ์ •๋ณด๋ฅผ ํฌํ•จํ•œ ๊ณต๊ฐœํ‚ค

์ด์ œ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•  key๋ฅผ ์ƒ์„ฑํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out [์ƒ์„ฑํ•  p12 ํŒŒ์ผ๋ช….p12] -name [๋ณ„์นญ] -CAfile chain.pem -caname root
keytool -importkeystore -deststorepass [์ธ์ฆ์„œ password] -destkeypass [์ธ์ฆ์„œ password] -destkeystore [์ƒ์„ฑ๋  jks ํŒŒ์ผ๋ช….jks] -srckeystore [์ƒ์„ฑํ•œ p12ํŒŒ์ผ] -srcstoretype PKCS12 -srcstorepass [PKCS12์—์„œ ์‚ฌ์šฉํ•œ ์•”ํ˜ธ] -alias [์œ„์—์„œ ์‚ฌ์šฉํ•œ ๋ณ„์นญ]
keytool -import -trustcacerts -alias root -file chain.pem -keystore [์ƒ์„ฑํ•œ jks ํŒŒ์ผ]

๋งˆ์ง€๋ง‰ import๊นŒ์ง€ ํ•˜๊ฒŒ๋˜๋ฉด ์ธ์ฆ์„œ ๊ด€๋ จ๋œ ์ž‘์—…์€ ๋ชจ๋‘ ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค.

์ด์ œ Spring boot ํ”„๋กœ์ ํŠธ๋กœ ๋Œ์•„์™€ application.yml ํŒŒ์ผ์„ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

์œ„์—์„œ ์ƒ์„ฑํ•œ jks ํŒŒ์ผ์„ resources ํด๋”์— ์˜ฎ๊ธด ํ›„ ์•„๋ž˜์™€ ๊ฐ™์ด ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

server:
  port: 443
  ssl:
    enabled: true
    key-store: classpath:everevent.jks
    key-store-password: # ์ธ์ฆ์„œ password
    key-password: # ์ธ์ฆ์„œ password

์ด๋ ‡๊ฒŒ ๋˜๋ฉด ๋ชจ๋“  ์„ค์ •์ด ๋๋‚ฉ๋‹ˆ๋‹ค.

์ฃผ์˜ํ•  ์ ์€ ์ด๋ ‡๊ฒŒ https๋กœ ์„ค์ •ํ•œ api์— ์ ‘๊ทผ ์‹œ ๋„๋ฉ”์ธ ๋ช…์œผ๋กœ ์ ‘๊ทผํ•ด์•ผ ssl ์ธ์ฆ์„œ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ์กด์˜ IP์ฃผ์†Œ๋กœ ์ ‘๊ทผํ•  ๊ฒฝ์šฐ ์ด์ „๊ณผ ๊ฐ™์€ ๊ฒฝ๊ณ ๋ฌธ๊ตฌ๊ฐ€ ๊ณ„์† ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

ex) https://everevent.kro.kr/test

 

 

 

๐Ÿ•‘ ํ•ด๊ฒฐํ•ด์•ผํ•  ์‚ฌํ•ญ

https ์ ์šฉ์€ ์„ฑ๊ณตํ–ˆ์ง€๋งŒ ํ•ด๋‹น ๋ฐฉ๋ฒ•์—๋Š” ๋ช‡๊ฐ€์ง€์˜ ๋ฌธ์ œ๊ฐ€ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.

  1. ๋„๋ฉ”์ธ ์ฃผ์†Œ์˜ ์œ ํšจ๊ธฐ๊ฐ„
  2. SSL ์ธ์ฆ์„œ์˜ ์œ ํšจ๊ธฐ๊ฐ„
  3. jks ํŒŒ์ผ์ด resource ํด๋” ๋‚ด๋ถ€์— ์žˆ์–ด public์œผ๋กœ ๋…ธ์ถœ๋จ

1๋ฒˆ์˜ ๊ฒฝ์šฐ๋Š” ๋‹ค๋ฅธ ๋ฌด๋ฃŒ ๋„๋ฉ”์ธ ๋ฐœ๊ธ‰ ์‚ฌ์ดํŠธ, ๋˜๋Š” ์œ ๋ฃŒ๋กœ ๋ฐœ๊ธ‰๋ฐ›์•„ ํ•ด๊ฒฐ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. (๋ฉ˜ํ† ๋‹˜์ด ๊ณต์œ ํ•ด์ฃผ์‹  ๋งํฌ ์ฐธ๊ณ  : https://cloud-oky.tistory.com/348)

2๋ฒˆ์˜ ๊ฒฝ์šฐ๋Š” ์ž๋™์œผ๋กœ SSL์„ ๊ฐฑ์‹ ํ•˜๋Š” ์„ค์ •์„ ์ถ”ํ›„์— ์„ค์ •ํ•  ๊ฒฝ์šฐ ํ•ด๊ฒฐ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

3๋ฒˆ์€ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ์กด์žฌํ•˜๋Š”๋ฐ, ์„œ๋ธŒ๋ชจ๋“ˆ๋กœ jks ํŒŒ์ผ์˜ ์œ„์น˜๋ฅผ ์˜ฎ๊ธฐ๋Š” ๋ฐฉ๋ฒ•๊ณผ ์„œ๋ฒ„์— nginx๋ฅผ ๋„์›Œ nginx์— ssl ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰ํ•˜๋Š” ๋ฐฉ๋ฒ• ์ž…๋‹ˆ๋‹ค. ์ด๋ถ€๋ถ„์€ ์ถ”ํ›„์˜ ๋ฆฌํŒฉํ† ๋ง์„ ํ†ตํ•ด ๋ฐฉํ–ฅ์„ ๊ฒฐ์ •ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

 

 

๐Ÿ“– ์ฐธ๊ณ ๋ฌธ์„œ


Mixed content : https://c17an.netlify.app/blog/front-end/Mixed-Content-์ด์Šˆ-ํ•ด๊ฒฐํ•˜๊ธฐ/article/

certbot ubuntu ์„ค์น˜ : https://www.manualfactory.net/13639

ssl ์ธ์ฆ์„œ ๋ฐœ๊ธ‰ : https://www.vompressor.com/tls1/

ํ”„๋กœ์ ํŠธ์— sslํ‚ค ์ ์šฉํ•˜๊ธฐ : https://elfinlas.github.io/2018/03/19/spring-boot-tls-certbot/

'Spring > Spring Security' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

ExceptionTranslationFilter  (0) 2021.11.15
AnonymousAuthenticationFilter  (0) 2021.11.15