今天刚升级到iOS9,发现网络请求失败,下面是错误代码
CFNetwork SSLHandshake failed (-9847)
2015-09-18 19:22:03.385 ViPiao2.0-Iphone[262:9101] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9847)
看了苹果官方说明
ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one. If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible.
apple建议我们用HTTPS,我们只要老版本的项目只需要在plist文件中配置