ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

CS/Network

[๋„คํŠธ์›Œํฌ] HTTP์™€ HTTPS

๊ฐœ๋ฐœ๊ฐœ๊ตด๐Ÿธ 2022. 6. 12. 19:36

HTTP๋ž€?

Hyper Text Transfer Protocol์˜ ์•ฝ์ž๋กœ, ์ธํ„ฐ๋„ท์—์„œ ํ…Œ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ํ”„๋กœํ† ์ฝœ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.

์ฆ‰, ์›น ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ๊ฐ„์˜ ๋ฌธ์„œ๋ฅผ ๊ตํ™˜ํ•˜๊ธฐ ์œ„ํ•œ ํ†ต์‹  ๊ทœ์•ฝ์ž…๋‹ˆ๋‹ค.

 

- HTTP๋Š” Request์™€ Response๋ฅผ ์œ„ํ•œ ๋ฉ”์‹œ์ง€๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ๊ตํ™˜

- ๊ธฐ๋ณธ์ ์œผ๋กœ 80๋ฒˆ ํฌํŠธ๋ฅผ ์‚ฌ์šฉ

- TCP/IP ๊ธฐ๋ฐ˜์œผ๋กœ ๋™์ž‘

 

HTTP์˜ ํŠน์ง•

1. ๋น„์—ฐ๊ฒฐ ์ง€ํ–ฅ

- ๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž์˜ ์š”์ฒญ์œผ๋กœ ์„œ๋ฒ„์™€ ์ ‘์†ํ•˜์—ฌ ์š”์ฒญ์— ๋Œ€ํ•œ ์‘๋‹ต์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๊ณ  ์—ฐ๊ฒฐ์„ ์ข…๋ฃŒ

- ์žฅ์  : ๊ฐ„๋‹จํ•˜๊ณ  ์ž์›์ด ์ ๊ฒŒ๋“ฆ

- ๋‹จ์  : ์—ฐ๊ฒฐ์ด ์ง€์†์ ์ด์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์šฉ์ž์™€ ์—ฐ๊ฒฐ ์ข…๋ฃŒํ›„ ์ถ”๊ฐ€์ ์ธ ์š”์ฒญ์‹œ ์–ด๋–ค ์‚ฌ์šฉ์ž์˜ ์š”์ฒญ์ธ์ง€ ์ธ์‹ ๋ถˆ๊ฐ€

 

์ด๋Ÿฌํ•œ ๋‹จ์ ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ์ฟ ํ‚ค, ์„ธ์…˜, ํžˆ๋“  ํผ ํ•„๋“œ ๋“ฑ์„ ์ด์šฉํ•ฉ๋‹ˆ๋‹ค.

 

2. ๋‹จ๋ฐฉํ–ฅ์„ฑ

- ์‚ฌ์šฉ์ž์˜ ์š”์ฒญ ํ•œ๊ฐœ์— ๋Œ€ํ•œ ํ•œ๊ฐœ์˜ ์‘๋‹ต์„ ๋ฐ›๋Š” ๋ฐฉ์‹

- ์„œ๋ฒ„๊ฐ€ ๋จผ์ € ์‘๋‹ตํ•˜์ง€ ์•Š์Œ

 

HTTP์˜ ๊ตฌ์กฐ

HTTP๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ ˆ๋ฒจ์˜ ํ”„๋กœํ† ์ฝœ๋กœ, TCP/IP ์œ„์—์„œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. 

HTTP๋Š” ์ƒํƒœ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์ง€ ์•Š์€ Stateless ํ”„๋กœํ† ์ฝœ์ด๋ฉฐ Method, Path, Version, Headers, Body๋“ฑ์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

 

HTTP์˜ Method์™€ ์ƒํƒœ์ฝ”๋“œ

 

https://j-su2.tistory.com/17

 

[๋„คํŠธ์›Œํฌ] HTTP์˜ Method์™€ ์ƒํƒœ์ฝ”๋“œ

HTTP๋ž€? https://j-su2.tistory.com/16 [๋„คํŠธ์›Œํฌ] HTTP์™€ HTTPS HTTP๋ž€? Hyper Text Transfer Protocol์˜ ์•ฝ์ž๋กœ, ์ธํ„ฐ๋„ท์—์„œ ํ…Œ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ํ”„๋กœํ† ์ฝœ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ์›น ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ๊ฐ„์˜..

j-su2.tistory.com

**Stateless

์„œ๋ฒ„๊ฐ€ ํด๋ผ์ด์–ธํŠธ์˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ƒํƒœ๋ฅผ ๋ณด์กดํ•˜์ง€ ์•Š์Œ๊ณ , ์„ธ์…˜์ƒํƒœ๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ƒํƒœ์™€ ๊ฐ™์Œ์„ ์˜๋ฏธ

 

HTTPS๋ž€?

Hyper Text Transfer Protocol Secure์˜ ์•ฝ์ž๋กœ, HTTP๋ฅผ ๋ณด์™„ํ•˜๊ธฐ ์œ„ํ•ด ํƒ„์ƒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

 

HTTP์˜ ๋‹จ์ 

- HTTP๋Š” ํ‰๋ฌธ ํ†ต์‹ ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋„์ฒญ์ด ๊ฐ€๋Šฅ

- ํ†ต์‹  ์ƒ๋Œ€๋ฅผ ํ™•์ธํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ์œ„์žฅ์ด ๊ฐ€๋Šฅ

- ์™„์ „์„ฑ์„ ์ฆ๋ช…ํ•  ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— ๋ณ€์กฐ๊ฐ€ ๊ฐ€๋Šฅ

 

์ฆ‰, ์ด๋Ÿฌํ•œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด HTTP์— ๋ฐ์ดํ„ฐ ์•”ํ˜ธํ™”๊ฐ€ ์ถ”๊ฐ€๋œ ํ”„๋กœํ† ์ฝœ์ด HTTPS์ž…๋‹ˆ๋‹ค.

 

- ๊ธฐ๋ณธ์ ์œผ๋กœ 443๋ฒˆ ํฌํŠธ๋ฅผ ์‚ฌ์šฉ

- ๋„คํŠธ์›Œํฌ ์ƒ์—์„œ ์ค‘๊ฐ„์— ์ œ3์ž๊ฐ€ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์—†๋„๋ก ์•”ํ˜ธํ™” ์ง€์›

- HTTP ํ†ต์‹ ํ•˜๋Š” ์†Œ์ผ“ ๋ถ€๋ถ„์— ์ธํ„ฐ๋„ท ์ƒ์—์„œ ์ •๋ณด๋ฅผ ์•”ํ˜ธํ™”ํ•˜๋Š” SSL(Secure Socket Layer)๋ผ๋Š” ํ”„๋กœํ† ์ฝœ๋กœ ๋Œ€์ฒด

- HTTP๋Š” SSL๊ณผ ํ†ต์‹ , SSL์ด TCP์™€ ํ†ต์‹  (์ฆ‰, ํ•˜๋‚˜์˜ ๋ ˆ์ด๋”๋ฅผ ์ถ”๊ฐ€ํ•œ ๊ฒƒ)

 

** SSL

Netscape์‚ฌ์—์„œ ์›น ์„œ๋ฒ„์™€ ๋ธŒ๋ผ์šฐ์ € ์‚ฌ์ด์˜ ๋ณด์™„์„ ์œ„ํ•ด ๋งŒ๋“ค์—ˆ๋Š”๋ฐ, CA(Certificate Authority)๋ผ ๋ถˆ๋ฆฌ๋Š” ์„œ๋“œ ํŒŒํ‹ฐ๋กœ๋ถ€ํ„ฐ ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ์˜ ์ธ์ฆ์„ ํ•˜๋Š”๋ฐ ์‚ฌ์šฉ๋จ

 

HTTPS์˜ ์•”ํ˜ธํ™”

HTTPS์˜ SSL์€ ๋Œ€์นญํ‚ค ์•”ํ˜ธํ™” ๋ฐฉ์‹๊ณผ ๋น„๋Œ€์นญํ‚ค ์•”ํ˜ธํ™” ๋ฐฉ์‹์„ ๋ชจ๋‘ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

 

HTTPS ๋™์ž‘ ๊ณผ์ •

๋Œ€์นญํ‚ค ์•”ํ˜ธํ™”์™€ ๋น„๋Œ€์นญํ‚ค ์•”ํ˜ธํ™”๋ฅผ ๋ชจ๋‘ ์‚ฌ์šฉํ•˜์—ฌ ๋น ๋ฅธ ์—ฐ์‚ฐ ์†๋„์™€ ์•ˆ์ •์„ฑ์„ ๋ณด์žฅํ•œ๋‹ค.

- ๋น„๋Œ€์นญํ‚ค : ์ฒ˜์Œ ์—ฐ๊ฒฐ์„ ์„ฑ๋ฆฝํ•˜์—ฌ ์•ˆ์ „ํ•˜๊ฒŒ ์„ธ์…˜ํ‚ค๋ฅผ ๊ณต์œ ํ•˜๋Š” ๊ณผ์ •

- ๋Œ€์นญํ‚ค : ๋ฐ์ดํ„ฐ๋ฅผ ๊ตํ™˜ํ•˜๋Š” ๊ณผ์ •

 

์—ฐ๊ฒฐ๊ณผ์ •(Hand-Shaking)

1. ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์„œ๋ฒ„๋กœ ์ตœ์ดˆ ์—ฐ๊ฒฐ์„ ์‹œ๋„ํ•จ

2. ์„œ๋ฒ„๋Š” ๊ณต๊ฐœํ‚ค๋ฅผ ๋ธŒ๋ผ์šฐ์ €์—๊ฒŒ ๋„˜๊ฒจ์คŒ

3. ๋ธŒ๋ผ์šฐ์ €๋Š” ์ธ์ฆ์„œ์˜ ์œ ํšจ์„ฑ์„ ๊ฒ€์‚ฌํ•˜๊ณ  ์„ธ์…˜ํ‚ค๋ฅผ ๋ฐœ๊ธ‰ํ•จ

4. ๋ธŒ๋ผ์šฐ์ €๋Š” ์„ธ์…˜ํ‚ค๋ฅผ ๋ณด๊ด€ํ•˜๋ฉฐ ์ถ”๊ฐ€๋กœ ์„œ๋ฒ„์˜ ๊ณต๊ฐœํ‚ค๋กœ ์„ธ์…˜ํ‚ค๋ฅผ ์•”ํ˜ธํ™”ํ•˜์—ฌ ์„œ๋ฒ„๋กœ ์ „์†กํ•จ

5. ์„œ๋ฒ„๋Š” ๊ฐœ์ธํ‚ค๋กœ ์•”ํ˜ธํ™”๋œ ์„ธ์…˜ํ‚ค๋ฅผ ๋ณตํ˜ธํ™”ํ•˜์—ฌ ์„ธ์…˜ํ‚ค๋ฅผ ์–ป์Œ

6. ํด๋ผ์ด์–ธํŠธ๋Š” ์„œ๋ฒ„์™€ ๋™์ผํ•œ ์„ธ์…˜ํ‚ค๋ฅผ ๊ณต์œ ํ•˜๋ฏ€๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•  ๋•Œ ์„ธ์…˜ํ‚ค๋กœ ์•”ํ˜ธํ™”/๋ณตํ˜ธํ™”๋ฅผ ์ง„ํ–‰ํ•จ

 

** ์„ธ์…˜ํ‚ค

์ฃผ๊ณ  ๋ฐ›๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์•”ํ˜ธํ™”ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” ๋Œ€์นญํ‚ค์ด๋ฉฐ, ๋ฐ์ดํ„ฐ ๊ฐ„์˜ ๊ตํ™˜์—๋Š” ๋น ๋ฅธ ์—ฐ์‚ฐ์†๋„๊ฐ€ ํ•„์š”ํ•ด์„œ ๋Œ€์นญํ‚ค๋กœ ๋งŒ๋“ฆ

 

HTTPS ๋ฐœ๊ธ‰ ๊ณผ์ •

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„๋ฅผ ์šด์˜ํ•˜๋Š” ๊ธฐ์—…์€ CA๋ฅผ ํ†ตํ•ด ์ธ์ฆ์„œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

 

1. HTTPS ์ ์šฉ์„ ์œ„ํ•ด ๊ณต๊ฐœํ‚ค์™€ ๊ฐœ์ธํ‚ค๋ฅผ ๋งŒ๋“ฆ

2. ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” CA ๊ธฐ์—…์„ ์„ ํƒํ•˜๊ณ  ๊ณต๊ฐœํ‚ค๋ฅผ ์ €์žฅํ•˜๋Š” ์ธ์ฆ์„œ ์ƒ์„ฑ์„ ์š”์ฒญ

3. CA๋Š” ์„œ๋ฒ„์˜ ๊ณต๊ฐœํ‚ค, ์•”ํ˜ธํ™” ๋ฐฉ๋ฒ• ๋“ฑ์˜ ์ •๋ณด๋ฅผ ๋‹ด์€ ์ธ์ฆ์„œ๋ฅผ ๋งŒ๋“ค๊ณ  ํ•ด๋‹น CA์˜ ๊ฐœ์ธํ‚ค๋กœ ์•”ํ˜ธํ™”ํ•˜์—ฌ ์„œ๋ฒ„์— ์ œ๊ณต

4. ํด๋ผ์ด์–ธํŠธ๊ฐ€ SSL๋กœ ์•”ํ˜ธํ™”๋œ ํŽ˜์ด์ง€(https://)๋ฅผ ์š”์ฒญ์‹œ ์„œ๋ฒ„๋Š” ์ธ์ฆ์„œ๋ฅผ ์ „์†ก

 

 

 

https://mangkyu.tistory.com/98

 

[Web] HTTP์™€ HTTPS์˜ ๊ฐœ๋… ๋ฐ ์ฐจ์ด์ 

1. HTTP๋ž€? [ HTTP(Hyper Text Transfer Protocol)๋ž€? ] HTTP(Hyper Text Transfer Protocol)๋ž€ ์„œ๋ฒ„/ํด๋ผ์ด์–ธํŠธ ๋ชจ๋ธ์„ ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ  ๋ฐ›๊ธฐ ์œ„ํ•œ ํ”„๋กœํ† ์ฝœ์ด๋‹ค. ์ฆ‰, HTTP๋Š” ์ธํ„ฐ๋„ท์—์„œ ํ•˜์ดํผํ…์ŠคํŠธ๋ฅผ ๊ตํ™˜..

mangkyu.tistory.com

https://opentutorials.org/course/3385/21673

 

HTTP ์†Œ๊ฐœ - ์ƒํ™œ์ฝ”๋”ฉ

์ˆ˜์—…์†Œ๊ฐœ HTTP๊ฐ€ ๋ฌด์—‡์ธ์ง€๋ฅผ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค. ํฌ๋กฌ ๊ฐœ๋ฐœ์ž ๋„๊ตฌ ๋‚ด์˜ ๋„คํŠธ์›ŒํŠธ ๊ธฐ๋Šฅ๋„ ์‚ด์ง ์‚ดํŽด๋ด…๋‹ˆ๋‹ค.  ๊ฐ•์˜

opentutorials.org

https://github.com/WooVictory/Ready-For-Tech-Interview/blob/master/Network/HTTP%2C%20HTTPS.md

 

GitHub - WooVictory/Ready-For-Tech-Interview: ๐Ÿ’ป ์‹ ์ž… ๊ฐœ๋ฐœ์ž๋กœ์„œ ์ค€๋น„๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ์ง€์‹์„ ์ •๋ฆฌํ•˜๋Š” ๊ณต๊ฐ„

๐Ÿ’ป ์‹ ์ž… ๊ฐœ๋ฐœ์ž๋กœ์„œ ์ค€๋น„๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ์ง€์‹์„ ์ •๋ฆฌํ•˜๋Š” ๊ณต๊ฐ„ ๐Ÿ‘จ‍๐Ÿ’ป. Contribute to WooVictory/Ready-For-Tech-Interview development by creating an account on GitHub.

github.com