iOS to Xojo middleware standalone Secure

A Xojo web app runs as standalone with a .crt file containing both a certificate and private key.
I can successfully acces it using a desktop webbrowser and get get response I want from the middleware web App.
The URL is secure and the SSL is accepted without a prompt.

But when I try to access the same URL from an iOS App, I get an SSL error -1200, which means that iOS does not accept the SSL as my desktop browser does.

the web app is accessible at https://dmarc.tools:8081/special/quote

middleware

That same link is used in the iOSHTTPSocketExample and returns the -1200 error.

Does anyone have an idea why the iOS App isn’t working?

Seems to work in the simulator. What device and iOS version did you use?

I tried using an iPhone 7 running 10.3 and from simulator on 10.12.3 , Xcode 8.2.1
Definitely not working on either; both give -1200 error.
On which combination did you get it to work?

My OS and Xcode are the same, but my simulator is set to iPhone 4s 8.4 32bit. That’s the oldest iPhone I currently have in service so I tend to start there for the few iPhone projects I have.

Make sure the certificate is showing as fully authorized ( you can tell by connecting to your app with Chrome or Firefox ). If any parts of the certificate are “missing” iOS may refuse to connect.

This discussion may shed some light:

https://discussions.apple.com/thread/7501176?start=0&tstart=0

@Greg O’Lone : Both Chrome and Firefox give me no errors and load the URL and return a quote,
only on the iOS App I’m having issues. The iPhone’s Safari and Chrome also return a quote, the only one that doesn’t is the iOS app, which is why I filed a bug report asking if this could be an iOS bug (report 47105)

[quote=317657:@Boudewijn Krijger]@Greg O’Lone : Both Chrome and Firefox give me no errors and load the URL and return a quote,
only on the iOS App I’m having issues. The iPhone’s Safari and Chrome also return a quote, the only one that doesn’t is the iOS app, which is why I filed a bug report asking if this could be an iOS bug (report 47105)[/quote]
Does your app work if you set the ValidateCertificates property to false?

No, it still fails on the full URL : https://dmarc.tools:8081/special/quote and passes on https://dmarc.tools, as that simply gets a return from the server handling requests on port 443.

@Greg O’Lone : So maybe I should not have filed it under iOS bug but under Web bug? If it is a bug at all…

No, it’s fine. I just looked at your case.

Running in debug mode and stepping through the PageReceived event makes it very obvious what’s going on.

[code]// The data comes in as UTF8
Dim response As Text
response = TextEncoding.UTF8.ConvertDataToText(Content, False)

// Convert the JSON into a Dictionary
Dim json As Dictionary
json = ParseJSON(response)

// Get the Quote value
QuoteArea.Text = json.Value(“Quote”)[/code]

The problem is that your app returns HTML not JSON. When it gets to the ParseJSON line, you get an exception because the response is not in JSON format.

@Greg O’Lone [quote]The problem is that your app returns HTML not JSON. When it gets to the ParseJSON line, you get an exception because the response is not in JSON format.[/quote]
Thanks for replying Greg, and although you are right that if it would connect, it would throw an exception,
but it does not throw the exception; it does not even get there as the connection is never established correctly.

When I add an info.plist allowing unsecure communication, the iOS app does get there (on port 8082) but on port 8081 it never does.

[quote=317850:@Boudewijn Krijger]@Greg O’Lone
Thanks for replying Greg, and although you are right that if it would connect, it would throw an exception,
but it does not throw the exception; it does not even get there as the connection is never established correctly.

When I add an info.plist allowing unsecure communication, the iOS app does get there (on port 8082) but on port 8081 it never does.[/quote]
Well it works here, that’s how I tracked this down.

@Greg O’Lone [quote]Well it works here, that’s how I tracked this down.[/quote]
Could it be you tested on older versions of Xcode/Mac OS? I’m on 10.12.3 using Xcode 8.2.1
I already saw from @Kevin Windham that it works on older version, but I am using the latest versions.
It would not surprise me Apple changed something causing it to no longer work.
It also does not work on iPhones running the latest available iOS.

@Boudewijn Krijger
Did you solved this issue ? I’m encountering the same problem

@Greg O’Lone
This issue has nothing to do with the kind of respond. I exactly have the same problem with the client receiving JSON has expected

@Pierre Vareilles
I had to do a workaround, as the problem still exists. (my workaround is making a non secure connection)
Not ideal, but until I can get it to work secured, it will do.
Like you, I think this is a bug.

@Boudewijn Krijger
Take a look at my previous post. Found something which works for me.

[quote=326359:@Pierre Vareilles]@Greg O’Lone
This issue has nothing to do with the kind of respond. I exactly have the same problem with the client receiving JSON has expected[/quote]
I am aware of that. The problem is that when I tested it on my setup here (10.12.3 with Xcode 8.3) I was unable to reproduce the problem where it didn’t connect at all. That’s why I was pointing Boudewijn to a possible problem with his SSL certificate.