Reputation: 1221
i read many questions about it, but still i have problem.
when i was using localhost and correct NSAppTransportSecurity optinos from my simulator, everything was correct.
now i am debuging on my iphone. both the iphone and the mac are connecting to the same network.
i check the ip address of my mac
and i added it to NSAppTransportSecurity like this:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>10.250.x.x</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
i am still getting error:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
error = 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=0x7f904d300170 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}, NSErrorFailingURLStringKey=http://10.250.x.x:8080/IVRServer/api/registration/register, NSErrorFailingURLKey=http://10.250.x.x:8080/IVRServer/api/registration/register, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.}
should i add anything else to my plist?
please don't consider this quesitn duplicated because i am already using the correct settings in my plist, and it is working fine, but just when i change the server to not localhost it is not working
what am i missing?
Upvotes: 1
Views: 386
Reputation: 80271
If you just want to bypass this restriction, allow all loads:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
This should be feasible because presumably you are using your "local host" so there should not be any security concerns.
Upvotes: 1