Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetHTTPHost(http, "www.example.com", 1) not working on my Android device

Author
Message
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Dec 2017 14:31 Edited at: 23rd Dec 2017 15:01
So I've finally purchased an SSL certificate (had to buy a multi domain one) which was an extortionate price. I've found from countless hours of testing that I can't apply it to the same domain that my app is currently using as it's going to break things so have bought an extra domain name for the app which I'll point new versions of the app too. The problem I'm finding is that when it comes to AppGameKit it won't connect to the secure domain on my Android device but does connect to the secure domain when running AppGameKit on my Mac.

Does anyone know why it might not be working on my device? I've tried uninstalling the app to clear old data and cache, and re-installing the new version. Rebooting the device. I also tried running it through the AppGameKit player on the phone but that doesn't work either. As mentioned it runs fine on my Mac. Here's the code I'm using (I'm not pointing to example.com in my program)



I'd give anything to go back and add SSL right at the start before the app was ever launched!
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Dec 2017 18:49 Edited at: 24th Dec 2017 00:57
The same code with an AppGameKit url works fine



And this is the code I'm using to access my new domain which works on the Mac but not my device. I only have the one device so can't see if it's a problem with just my device or it's a problem on all Androids.



https://www.kevincross.co.uk/index.php loads fine in Chrome on the device. And I've tried the URL with and without the www in the AppGameKit script.

As it only returns a -1 I'm at loss on how to work out what the true problem is. If it was a problem with the certificate I'd expect it to not work on the Mac either.
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Dec 2017 23:22
This has pretty much stumped me for days now and have tried pretty much anything and everything I can think of.

I briefly signed up for (and then cancelled) a 1&1 hosting account which has free SSL certificates and that worked fine so it's something do with the GoDaddy certificate setup that AGK/Android doesn't like.

It's safe to say that I'm not going to get to the bottom of the problem when all I see is -1 so will look around for another SSL and hosting provider.
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 24th Dec 2017 17:41
Hi Kevin,

Just something to try - this pointed me in the right direction when my connection from iOS and Android wouldn't play ball. Here:



Have you tried putting a php file (or html file) in the root, without the path, and then seeing whether your app can retrieve it on Android?



or



I wonder whether it's a problem with paths or with capitalisation - are all of your folders and files in lower case only on the server?

A shot in the dark, but hope this helps!

James
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 24th Dec 2017 17:47
Another thought. You could also try retrieving https://www.example.com/dateandtime.php using Android's web browser to see if it complains about the certificate.

James
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 24th Dec 2017 18:02
Hi Jambo

I could access the page/site that had the certificate fine in the browser, just not in the app but it would work when accessing the page from the app running on my Mac.

It must have had something to do with the settings with the GoDaddy hosting/SSL certificate and Android (or at least my device) as I was able to access other https sites from the app on my device.

I've now got it working by signing up to another host provider which offers free SSL certificates with LetsEncrypt. Thankfully GoDaddy has refunded the £134 I paid for the certificates. I've tested that the page returns a 1 with a secure connection so hopefully the app should work as expected when I move over the scripts to the new server.

Thanks,
Kevin
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 24th Dec 2017 18:08
Ah, a good result. SSL is not straightforward (I had to mess around for a while with mine, too). Glad you got it working - you should treat yourself to a Christmas Eve beer.

Login to post a reply

Server time is: 2024-04-19 07:30:42
Your offset time is: 2024-04-19 07:30:42