URLConnection.SendSync kCFStreamErrorDomainSSL Error

Hello,

When calling URLConnection.SendSync on a secure website (like “https://www.google.com”) from a HTTPRequestThread (like a PushButton on a WebPage) it seems to timeout and log an error in the debug log.

[54961:8762411] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

It would appear to only happen in HTTPRequestThread’s, it works fine in the App.Open Event.

Sample code:

Dim Sock As New URLConnection
Dim s As String = Sock.SendSync("GET","https://www.google.com",10)
Break

Running the same code but with a HTTP connection causes the URLConnection to hang and never timeout (at least 5 minutes, I didn’t wait any longer)

Can anyone confirm this is happening?

Thanks,
Alex

Setup: macOS High Serria 10.13.6

https://blog.xojo.com/2018/12/14/app-transport-security-on-macos/ ?

Hello, I did test all the recomended changes before. It would appear to not be an issue for desktop apps, only web apps, and only in threads. The links I was testing with were both HTTPS and using latests security standards. Calling the code from the main thread does not cause this issue.

Make a simple and example and report as bug. Should web apps have threads?

Will do, I am pretty sure that each HTTP request to the web app is run in their own thread.

Thanks

Console apps don’t support plist files in Xojo. A feature request was just filed in January.

You might try using a Timer (as opposed to a WebTimer) as those always fire on the main thread.

I’m under Mac OS Mojave with the Xojo 2020r1.
I added an URLConnection to my window and I do :

Dim RetPgCont as String
RetPgCont = URLCnctCoordGps.SendSync("Get", "https://throb.pagesperso-orange.fr/AnnVideos-PC1/BecaFire/BecaFire-v2_fnct-Pres.mp4", 2)

I do the test with a video which take more than 2 seconds to download and my app freeze during all the download time. The freeze is normal as explained in the doc, but why the TimeOut doesn’t occur after 2 seconds ?
Note : In my app I get a string and everything ok, I just wanted to test TimeOut.

Edit : I opened the example “URLConnectionGET.xojo_binary_project” and put my video link and the TimeOut doesn’t occur neither.

I answer to myself.
I thought it was a bug then I filled a bug report n°62392 and Greg O’Lone answered :

Timeout is the time to establish a connection, not to complete the download.