[iOS] http 통신 가능하도록 설정하기

홍승현·2022년 11월 27일
0

Network

목록 보기
1/1

http로 이루어진 URL로 요청을 보낼 때 다음과 같은 경고를 마주할 것이다.

NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

이유는, http가 보안에 취약하기 때문에 Error메시지를 내는 것.

단지 테스트를 목적으로 통신하는 경우도 있기에, info.plist에서 값을 설정하여 http 상으로도 요청 및 응답이 가능하도록 설정할 수 있다.

위 사진과 같이 Information Property List -> App Transport Security Settings -> Allow Arbitary Loads까지 추가한 뒤, 기본값인 NOYES로 수정하면 해결된다.

어디까지나 테스트일 때만 사용하고, 배포를 준비할 때는 가급적 https를 이용하자 ^^

profile
블로그 이전: https://www.whitehyun.com

0개의 댓글