How to handle “CFNetwork SSLHandshake failed” in iOS

非 Y 不嫁゛ 提交于 2019-11-27 14:33:56

Normally when I get CFNetwork SSLHandshake failed -(*) Its because of my local wifi network (device is connected to network but not the internet)

Try it again on another network (3G is the quickest solution for me)

Antoine

This could also happen because of iOS 9. iOS 9 and OSX 10.11 require TLSv1.2 SSL for all hosts you plan to request data from unless you specify exception domains in your app's Info.plist file.

You can find more info here: https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/

Or Steven Peterson's answer here, which is quite clear: https://stackoverflow.com/a/30720929/1485701

Had the same issue and after I have confirmed that the server is getting the POST the solution was this:

  • Clean the project: Product -> Clean
  • Delete your app from the iOS device/iOS Simulator and quit the Simulator
  • Compile your app and run it

In my case, simple as that.

I had the same problem, and in my case the solution was that in my code I wrote

initWithScheme:@"https"

instead of

initWithScheme:@"http"

So make sure you use the correct protocol

mramonlopez

Another solution: check if date/time is set correctly in your phone. SSL certificates are valid UNTIL certain date.

https://superuser.com/a/760211

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!