Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made.

Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made.
这个我设置了
App Transport Security Settings
Allow Arbitrary Loads
也设置了Exception Domains但是还不是不行
还是请求不到服务器的数据,但是安卓和web都可以的,这是什么情况,还是需要设置什么,我用的网络请求框架是AFnetworking

As the error message indicates:

NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made.

It looks like you have a TLS error with a connection to your server. First, I will always recommend that apps use TLS and should not set Allow Arbitrary Loads unless there is a very good reason. If you are able to use TLS and can remove this ATS override then I would take a look at your certificates on the server and make sure they are up to date with the latest trust requirements.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

hello,Have you solved the problem?I have the same error,but it hardly occurred repeatly.

Error -1200 is NSURLErrorSecureConnectionFailed, which is very generic. It means that something went wrong for TLS. It’s very unlikely that your app is failing for the same reason as baigui’s.

I recommend that you start a new thread with the details of the failure you’re seeing. Tag it with CFNetwork and Security so that the right folks see it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made.
 
 
Q