์˜ˆ์ „์— ๋„คํŠธ์›Œํฌ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๋ฉด์„œ ๋งž๋‹ฅ๋“ค์˜€๋˜ ๋ฌธ์ œ๋ฅผ ๋‹ค์‹œํ•œ๋ฒˆ ์ ์–ด๋ณธ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ ๊ฐœ๋…๊นŒ์ง€ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •๋ฆฌํ•ด๋ณธ๋‹ค.

Problem

App Transport Security has blocked a cleartext HTTP resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

์ด๋Ÿฐ ์—๋Ÿฌ๋ฅผ ๋ณธ ์ ์ด ์žˆ๋‹ค. ๊ฒฐ๋ก ์ ์œผ๋กœ ๋ณด์•ˆ์— ์ทจ์•ฝํ•œ, ์ฆ‰ HTTP๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ๋ณด์•ˆ์„ค์ •์„ ๋ฐ”๊ฟ”์ฃผ์–ด์•ผ ํ•œ๋‹ค๋Š” ์—๋Ÿฌ์ด๋‹ค.

Solution

๋‹น์žฅ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์กฐ์น˜๋ฅผ ์ทจํ•ด์ฃผ๋ฉด ๋œ๋‹ค. Inpo.plist์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์ •ํ•ด์ฃผ์ž.

App Transport Security

์ด์ œ App Transport Security ์ด๋…€์„์ด ๋ฌด์—‡์ธ์ง€ ์•Œ์•„๋ณผ ํ•„์š”๊ฐ€ ์žˆ๋‹ค.

๋‹ค์–‘ํ•œ ์ข…๋ฅ˜์˜ App์ด ๊ฐœ์ธ ์ •๋ณด๋ฅผ ๋‹ค๋ฃจ๊ฒŒ ๋˜๋ฉด์„œ, ์‚ฌ์šฉ์ž ์ •๋ณด ๋ณดํ˜ธ์— ๋Œ€ํ•œ ์ค‘์š”์„ฑ์ด ๋†’์•„์กŒ๋‹ค. ๊ธฐ์กด์˜ ๋ณด์•ˆ/์•”ํ˜ธ ๊ธฐ์ˆ ์ด ์˜ค๋ž˜๋˜๋ฉด์„œ ๊ณต๊ฒฉ์— ์ทจ์•ฝํ•ด์กŒ๊ณ , ๊ทธ์— ๋น„ํ•ด ์ปดํ“จํ„ฐ ์„ฑ๋Šฅ์€ ๋น„์•ฝ์ ์œผ๋กœ ๋ฐœ์ „ํ•˜๋ฉด์„œ ์ƒˆ๋กœ์šด ๋„คํŠธ์›Œํฌ ๊ณต๊ฒฉ์— ๋Œ€์‘์ด ํ•„์š”ํ–ˆ๋‹ค. ์ด์— 2015๋…„ ๋„์ž…ํ•˜๊ฒŒ ๋œ๋‹ค. 2016๋…„ ์ดํ›„๋ถ€ํ„ฐ ์ƒˆ๋กญ๊ฒŒ ๋งŒ๋“ค์–ด์ง€๋Š” App์€ ๋ฐ˜๋“œ์‹œ ATS๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.

๊ธฐ๋ณธ์ ์œผ๋กœ URLSession, CFURL, NSURLConnection API๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ  ๋ฐ›๋Š” ๊ฒฝ์šฐ ATS ๊ธฐ๋Šฅ์ด ๊ธฐ๋ณธ์ ์œผ๋กœ ์ผœ์ ธ์žˆ๋‹ค. ATS ๊ธฐ๋Šฅ์ด ์ผœ์ ธ์žˆ๋‹ค๋ฉด HTTP ํ†ต์‹ ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. Apple์—์„œ ๊ถŒ์žฅํ•˜๋Š” ์š”๊ตฌ์‚ฌํ•ญ์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • Server: TLS(Transport Layer Security) protocol version >= 1.2
  • 2048bit ์ด์ƒ์˜ RSA Key Or ECC Key๊ฐ€ ์žˆ๋Š” SHA256์„ ์ธ์ฆ์„œ์— ์‚ฌ์šฉ

์ž์„ธํ•œ ๋‚ด์šฉ์€ Preventing Insecure Network Connections์„ ์ฐธ๊ณ ํ•˜์ž.

TLS(Transport Layer Security): ์ธํ„ฐ๋„ท์—์„œ์˜ ์ •๋ณด๋ฅผ ์•”ํ˜ธํ™”ํ•ด์„œ ์†ก์ˆ˜์‹ ํ•˜๋Š” ํ”„๋กœํ† ์ฝœ
HTTPS: TLS์œ„์— HTTP์„ ์–น์€ ๋ณด์•ˆ๋œ HTTP ํ†ต์‹ ์„ ํ•˜๋Š” Protocol

Exception

๋ณดํ†ต์€ ATS๋ฅผ ์ผœ๋Š” ๊ฒƒ์ด ๋‹น์—ฐํžˆ ์ข‹๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ˆ์™ธ์˜ ๊ฒฝ์šฐ ATS๋ฅผ ๋น„ํ™œ์„ฑํ™” ํ•  ์ˆ˜ ์žˆ๋‹ค.

  • AVFoundation ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ํ†ตํ•œ ์ŠคํŠธ๋ฆฌ๋ฐ ์„œ๋น„์Šค
  • WebKit์„ ํ†ตํ•œ ์ฝ˜ํ…์ธ  ์š”์ฒญ
  • ๋กœ์ปฌ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ

์ด ์™ธ์— ์ž„์‹œ์ ์œผ๋กœ ์œ ์ง€๋ณด์ˆ˜๋ฅผ ์œ„ํ•ด ATS๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์ง€๋งŒ, AppStore ์‹ฌ์‚ฌ์‹œ์—๋Š” ์ด๋ฅผ ์œ„ํ•œ ์ •๋‹นํ•œ ์ด์œ ๊ฐ€ ํ•„์š”ํ•  ์ˆ˜ ์žˆ๋‹ค.

๋งˆ๋ฌด๋ฆฌ

๊ฐ„๋‹จํ•˜๊ฒŒ ATS ๋ฌธ์ œํ•ด๊ฒฐ ๋ฐฉ๋ฒ•๊ณผ ๋ฌด์—‡์ธ์ง€์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์•˜๋‹ค. ๋!

Reference