티스토리 뷰
웹으로는 잘 보이는 API가 시뮬레이터로는 접근이 불가능한 문제가 발생했다.
void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL
[boringssl] boringssl_context_handle_fatal_alert(1991) [C1.1.1.1:2][0x12a8680d0] read alert, level: fatal, description: illegal parameter
[boringssl] boringssl_session_handshake_incomplete(88) [C1.1.1.1:2][0x12a8680d0] SSL library error
[boringssl] boringssl_session_handshake_error_print(43) [C1.1.1.1:2][0x12a8680d0] Error: 4999014808:error:10000417:SSL routines:OPENSSL_internal:SSLV3_ALERT_ILLEGAL_PARAMETER:/Library/Caches/com.apple.xbs/Sources/boringssl_Sim/ssl/tls_record.cc:594:SSL alert number 47
[boringssl] nw_protocol_boringssl_handshake_negotiate_proceed(771) [C1.1.1.1:2][0x12a8680d0] handshake failed at state 12288: not completed
Connection 1: received failure notification
Connection 1: failed to connect 3:-9830, reason -1
Connection 1: encountered error(3:-9830)
Task <B9D06294-2174-44CE-B099-F5D6B6F7B064>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9830])
Task <B9D06294-2174-44CE-B099-F5D6B6F7B064>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=
Error Domain=NSURLErrorDomain Code=-1200
이러한 에러가 발생했다.
SSL 오류가 발생했기 때문에 서버에 안전하게 연결할 수 없다고 한다.
해결방법
앱 폴더에 들어가면 Info.plist라는 파일이 존재한다
<변경전>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array/>
</dict>
</array>
</dict>
</plist>
이러한 기존의 Info.plist 파일을
<변경후>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array/>
</dict>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
이렇게
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
이 부분만 추가해주면 성공적으로 불러와지는 것을 볼 수 있다.
'SwiftUI' 카테고리의 다른 글
상태 프로퍼티, Observable, Environment 객체와 한 발짝 가까워지기... (0) | 2022.10.28 |
---|
댓글