Looking for guidance to set up a LiveCode https server

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Looking for guidance to set up a LiveCode https server

Post by Monox18 » Wed Jan 27, 2021 12:21 am

Recently I have been migrating all my client/server communication from http to https. The non-LC programs that I use as server and support encryption were easy to change to https. But I'm having issues with a client made in LiveCode and also a server made in LC (normal Indy flavor, not server LC version).

A LC client does support encryption with the "open secure socket..." command. But the LC server using "accept connections on port..." does not support encryption as stated in bug 16871 https://quality.livecode.com/show_bug.cgi?id=16871

So could someone guide me in what options I have to change the communication from http to https? My LC server app is an standalone that constantly reads a sensor data and makes this data available for read/write to the LC clients, chat app between users, among other stuff. An Internet of Things application. Some of the options I can think of (which I would like to confirm with the community):

1) From that bug report it was suggested to use stunnel to wrap the sockets. It's great in the sense that I don't have to do any code modifications and it's free software but bad as it is a GNU GPL license (copyleft) which I don't like.

2) Change the code so that the LC server now becomes a client of a proper web server, and this web server would act as a middleware between LC client app and LC server app.

3) Implement my own web server now with the proper LC server flavor, and follow the guides to install Apache, also installing my SSL certificates. Then let Apache handle the encryption stuff. So communication would be all the way encrypted up until the web server, and from there it would be unencrypted until my LC server app in a local LAN. Is this correct? I don't really understand much of this LC server engine flavor.

Any other ideas?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Looking for guidance to set up a LiveCode https server

Post by FourthWorld » Wed Jan 27, 2021 12:43 am

If you have the time to do #2 that would be an awesome contribution to the community.

But #3 is simpler, more robust, and more efficient than writing the generic httpd role in a scripting language. Bonus that it saves you a ton of time you can spend on your application-specific functionality.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Looking for guidance to set up a LiveCode https server

Post by Monox18 » Wed Jan 27, 2021 1:02 am

Tnx for the quick reply. Well about #2, I meant changing the code/architecture in my app to utilize some other web server. Switching to a more subscriber/subscription mechanism rather than a direct client-server connection. I suppose you understood I wanted to change the engine source code? I can't do that, I doubt I can bring an awesome contributtion with my non existant C programming skills...

About #3, I don't even know what an Apache is but that is the recommendation a friend gave me, which I wanted to confirm here. So yeah, that seems the way to go. I will be starting tomorrow researching all this webserver setup stuff Apache, LC server & SSL. Thanks for pointing that it is a simple, robust and efficient solution. So indeed #3 is the way to go.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Post Reply

Return to “Internet”