If you try to make HTTP requests with ATS enabled (using NSURLSession or libraries like AFNetworking), you’ll see errors like this.
Here’s how to disable ATS entirely. Open Info.plist, and add the following lines:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
You have to add just the NSAllowsArbitraryLoads key to YES in NSAppTransportSecurity dictionary in your info.plist file.
相關文章:
- https://stackoverflow.com/questions/33600325/error-domain-nsurlerrordomain-code-1200-an-ssl-error-has-occurred-and-a-secure
- https://stackoverflow.com/questions/5040531/ssl-error-in-connection-to-server-through-iphone
- https://stackoverflow.com/questions/32755674/ios9-getting-error-an-ssl-error-has-occurred-and-a-secure-connection-to-the-ser