Search code examples
swift3ios10nsurlsessionapp-transport-securityxcode8.2

POST request error: NSURLConnection HTTP load failed iOS 10


I'm new to iOS programming. I want to connect my app to my web service (HTTPS).

Why is XCode telling me this error when I run POST request with 'Alamofire 4.0' in iOS 10?

enter image description here

This error doesn't appear when I use iOS 9 simulator. I've tried various ways as people say on stackoverflow and none of them solved my problem.

Update:

I have added this inside my info.plist, and still get the same error.

enter image description here

How to implement ATS in iOS 10?

Thanks in advance.


Solution

  • In my case, I changed the SSL certificate on my API domain with the trusted one as mentioned by Apple in this link.