0

I am using Alamofire in a Swift app I am developing. Recently whenever I try to perform a network call in the simulator iPhone5 8.1 (or any simulator 8.1) I am getting:

Optional(Error Domain=NSURLErrorDomain Code=-1005 "The operation couldn’t be completed. (NSURLErrorDomain error -1005.)" UserInfo=0x7f9d148ac2c0 {NSErrorFailingURLStringKey=https:[URL REMOVED], NSErrorFailingURLKey=https:[URL REMOVED], _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=57, NSUnderlyingError=0x7f9d1273f0a0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1005.)"})

This use to work fine up until about a day ago. The only things I have changed are the servers are now sitting on Windows/IIS EC2 instances behind a load balancer and the request is no longer a HTTP but it is HTTPS.

I had app transport configured when using HTTP but removed now everything is over HTTPS. I tried putting it back but still nothing.

I have disabled keepalive headers on IIS but I can't seem to get any connection to go through.

I have read through the comments here https://github.com/AFNetworking/AFNetworking/issues/2314 but nothing in that post works.

Help please?!?!

puks1978
  • 3,667
  • 11
  • 44
  • 103
  • Are you using a self signed certificate in the backend? – Kumuluzz May 09 '16 at 12:29
  • Nope. Purchased and all working correctly as I have iOS 9 working perfectly plus other subdomains using the ssl. – puks1978 May 09 '16 at 13:08
  • Is the error thrown right away when making the call? Otherwise have you tried to increase the keep-alive timeout for the backend like mentioned by other people in the GitHub issue you linked to? http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost/25996971 – Kumuluzz May 09 '16 at 13:12
  • Yes the error is immediate. I have disabled keep alive in the IIS servers. The load balancer does have sticky sessions enabled HOWEVER as this point in time there is only one server in the cluster so all traffic is going to one. – puks1978 May 09 '16 at 23:45
  • @puks1978 Did you find out the reason? Facing similar issues. Thanks – Shobhit Puri Aug 04 '19 at 04:25

0 Answers0