URL connects not working on OS X 10.9.5?

Sorry for the vague question in advance.

Has anyone experienced or got any insight on why URL calls with POST parameters don’t work on OS X 10.9.5?

I don’t have a system running that operating system to test with yet, but I will try to set one up. But I have received a couple reports that running my app on that operating system fails connecting to the internet.

My app is compiled with c++17, with the target deployment set to OS x 10.9, and compiled on Xcode 10 running on OSX 10.13.6.

It might be that the server you’re trying to connect to, uses a protocol (TLS 1.2) that is not supported by OSX 10.9.

1 Like

Thanks! That’s something I would have never thought to consider. I’ll investigate

Alright, I found some potentially insightful stuff on this. Unfortunately, I don’t know enough Objective C to know how to modify the juce::URLConnectionState::run function to use NSURLSession instead of NSURLConnection to test this snippet.

For the record, I do not have this issue on anything including OS X 10.11 or newer.

https://www.objc.io/issues/5-ios7/from-nsurlconnection-to-nsurlsession/

I wish I could supply a potential fix for this, but I don’t know enough ObjC or how to use the NSURLSession ObjC stuff to even be remotely helpful here. I’m hoping one of the folks on the JUCE team can take a look at this.

Here is the error log I’m getting on OS X 10.9.5 when I try to connect to my secure server, which is running TLS v1.2 or newer:

2020-09-09 00:00:38.013 CFNetwork SSLHandshake failed (-9824)
2020-09-09 00:00:38.181 CFNetwork SSLHandshake failed (-9836)
2020-09-09 00:00:38.339 CFNetwork SSLHandshake failed (-9824)
2020-09-09 00:00:38.340 NSURLConnection/CFURLConnection HTTP load failed 
(kCFStreamErrorDomainSSL, -9824)

Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure
 connection to the server cannot be made." UserInfo=0x7fce79e430e0 
{NSUnderlyingError=0x7fce79e53000 "An SSL error has occurred and a secure 
connection to the server cannot be made.", NSErrorFailingURLStringKey=https://www.mywebsite.com/, 
NSErrorFailingURLKey=https://www.mywebsite.com/, 
NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, 
NSLocalizedDescription=An SSL error has occurred and a secure connection to the 
server cannot be made.}

As far as I can tell, all of those CFNetwork errors are all related to this use of NSURLConnection in the juce::URLConnectionState class on OS X.

:crossed_fingers: :crossed_fingers: that one of the JUCE team folks know how to get that switch to NSURLSession implemented for testing!

This is not a bug in anybody’s code. You can see from the error message the server returned

An SSL error has occurred and a secure connection to the server cannot be made.

that the OS can not establish a secure connection. This might be related to the protocol or to the internal certificate store that might be outdated. I’m afraid there is nothing anyone can do.

If you have control over the server you’re connecting to, consider downgrading its protocol to TLS 1.1 and then try again?

1 Like

Thanks, @reFX. i chatted with my host’s tech support, and they showed me where to change the server TLS setting for Apache. It was already on v1.1. I changed it back to v1.2, restarted apache, and of course, OS X 10.9.5 started behaving correctly and my app ran as expected. This server-side stuff is annoying to solve and debug but I’m glad it’s solved now. Thank you for suggesting I change the TLS version on the server!

added: Does the JUCE team know why they’re still using NSURLConnection instead of the more modern NSURLSession?