ATS(App Transport Security) 예외 도메인을 적용했는데도 ATS 오류가 날 때 확인 방법
ATS? WWDC 2016에서 발표된 ATS (App Transport Security) 도입은 iOS9부터 적용되었습니다. SSL 통신을 해야하고 최소 TLSv1.2를 만족해야 하며, 인증서는 SHA256 이상의 해쉬 알고리즘으로 서명되어야 한다는 의미입니다. 하지만 이를 당장에 만족시키기에는 무리다보니 선택적으로 적용되었고 2016년 12월말까지는 필수 적용을 해야한다고 발표했습니다. (그 후 연기가 되었고 지금은 어떤지 모르겠습니다..) 하지만 ATS를 설정한 이후에는 규칙과 예외 도메인을 관리해야하니 귀찮긴합니다… 설정하는 디테일 한 방법은 이 글에서 설명을 하진 않겠습니다. 오류 발생 ATS를 잘 정의했는데 관련 도메인의 추가 등의 이슈로 어느 순간 만날 수 있는 오류 메시지가 있습니다. Connection failed: Error Domain=NSURLErrorDomain Code=-1022 “The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.” UserInfo={NSUnderlyingError=0x7fada0f31880 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 “(null)”}, NSErrorFailingURLStringKey=MyServiceURL, NSErrorFailingURLKey=MyServiceURL, 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…