NSURLConnection not working on iPhone 6/6 Plus

I have a podcast player app uses NSURLConnection sendSynchronousRequest to get the episode list from the podcast feed. The URL for one of the podcast feeds has a username and password (http://username:password@hostname/path). Creating a request (NSURLRequest) with this URL, I use NSURLConnection sendSynchronousRequest. It returns with no error on all devices, but has the episode list content on iPhone 4S/5 and no content on iPhone 6/6 Plus.


The URL for the other podcast feed has no username/password and works fine on all devices.


Any idea what is up?


alan

There are many potential causes for problems like this. The first thing I’d do is disable caching on the request so that you can guarantee that it hits the ‘wire’. To do this, set the request’s

cachePolicy
property to
.ReloadIgnoringLocalCacheData
(either directly in an NSMutableRequest or via the initialiser in an NSURLRequest).

From there, you can use a packet trace to see whether you’re getting an empty response because the server sent you an empty response. If that’s the case, you could use the techniques I described in Debugging HTTP Server-Side Errors to investigate further.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Given that this works with no issues on iPhone 4s and 5, how can this be a server issue?


I have since changed the code and am getting a slightly different failure.


Now it works on iPhone 4S and fails on everything else. When it fails, the establishing the connection fails and I get:

2016-05-07 22:54:45.524 bhp[14863:3278513] CFNetwork SSLHandshake failed (-9847)

2016-05-07 22:54:45.721 bhp[14863:3278513] CFNetwork SSLHandshake failed (-9847)

2016-05-07 22:54:45.919 bhp[14863:3278513] CFNetwork SSLHandshake failed (-9847)

2016-05-07 22:54:45.920 bhp[14863:3278513] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9847)

I have since changed the code and am getting a slightly different failure.

I’d say completely different (-:

Error -9847 is

errSSLRecordOverflow
. This is a transport error related to setting up the TLS connection between your client and the server. Presuming that all the client devices are running the same OS version, there’s no obvious cause for that error. You’re going to have to look at the traffic on the ‘wire’. QA1176 Getting a Packet Trace describes how to do that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
NSURLConnection not working on iPhone 6/6 Plus
 
 
Q