0

I have been using ASIHTTPRequest to do a simple POST upload of a "Scores and Settings" xml file to my server on an iOS game. As of iOS 5, ASIHTTPRequest is having some issues, and as mentioned here the library has been abandoned.

My question: What actually broke in iOS 5? I have looked at the other options for doing HTTP connections and uploading and they look heavy-hitting and a bit difficult compared to the ASI lib. If possible, I'd like to fix it, but I can't seem to figure out why it's not working. I just get:

[STATUS] Request Failed.
[STATUS] Starting asynchronous request.

Weird that the "Failed" line prints first, eh?

I have tried the suggestions at iOS 5 : https ( ASIHTTPRequest) stop working as well.

Community
  • 1
  • 1
buildsucceeded
  • 4,203
  • 4
  • 34
  • 72

1 Answers1

0

I presume the server you're having a problem with is https?

The main change is explained here:

http://developer.apple.com/library/ios/#technotes/tn2287/_index.html#//apple_ref/doc/uid/DTS40011309

However you say you've already the solutions that would fix problems related to this.

There are some more suggestions here:

https://github.com/pokeb/asi-http-request/issues/273

In particular:

After opening a support incident with Apple and a lot of back and forth I finally resolved my issue with accessing certain https URLs on iOS5. It turns out that a change was made in the iOS 5 networking code which causes iOS to reject secure connections if the server uses a non-standard key length. The server I was talking to had a 2056 byte key, instead of the typical 2048 bytes. I was able to get the server admins to regenerate their key and now everything works fine again.

Does the same server work okay in Safari on the same device?

JosephH
  • 37,173
  • 19
  • 130
  • 154
  • Server works, but not from Safari bc of the sandboxed environment. At least, I don't know enough to write a test for it-- the "Upload" button on my test page is just greyed out. – buildsucceeded Jan 17 '12 at 01:04
  • Would the world end if I just used http and not https? – buildsucceeded Jan 17 '12 at 01:04
  • You don't need to upload anything to the server. You just need to display one page from the server in Safari on the device, as this will check whether the problem is ASIHTTPRequest specific or not. We can't answer the "do I need to use https?" question - if you don't care too much about people being hack your scores and settings files and there's no personal information or passwords in there, then maybe you don't. – JosephH Jan 17 '12 at 08:42
  • Ah yes, ok, then, the server works fine otherwise. I guess maybe it *is* time to look at MKNetworkKit or AFNetworking... – buildsucceeded Jan 17 '12 at 11:51