Secure connection to server
rdimola at evergreeninfo.net
Tue Dec 22 16:48:35 EST 2020
I'm able to have the socket client and server on the same device. (Win 10)
Evergreen Information Services
rdimola at evergreeninfo.net
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Bob Sneidar via use-livecode
Sent: Tuesday, December 22, 2020 4:34 PM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Re: Secure connection to server
I created a simple client and server stack combo that uses sockets to pass an encrypted stream of data back and forth. I have been meaning to implement it for the very reasons you suggest, but since the nature of the data doesn’t demand it, and since I develop basically gratis for the company I work for, it hasn’t been a priority. The concept is simple though. Start with a server stack that listens on a certain port, then create a client stack that opens a port to that server. (You can’t do it on a single workstation, the server has to be a different device.)
Once you have that, code the server to accept the data, then send it back to the client. Once that is working, encrypt / decrypt the data both ways and check that what you sent is what you receive.
Finally code the server to receive the data, do some process then return the resulting data. Simple, right? :-)
On Dec 15, 2020, at 4:32 PM, Neville Smythe via use-livecode <use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>> wrote:
A little while ago in this forum we were alerted to the fact that LC direct connection to a remote database not using SSL was a security hole. This also applies to managing Mailman lists on a remote server.
After a steep (re-)learning curve with the various technologies, I now have a working method in place for both mysql and Mailman connections, using php as middleware and posting via curl in a shell script. But it is sooo slooow.
Direct connection downloaded an sql query in a fraction of a second. It now takes over a second. This is acceptable (barely) for an isolated call, but I sometimes need to make a sequence of posts. As I understand it, the slowness is due to the time required to establish the secure connection, not an LC problem. For example establishing an ssh connection in Terminal is even slower; but once established an ssh session is super fast. Similarly curl will reuse authentication credentials within a shell session, so I aggregate as many calls as I can with a single shell script before using shell(myscript), and this definitely helps.
What I would like to do however is use LC server as the middleware: I could then process the required data on the server side; I could not contemplate using php to do this. I suspect the LC post command uses curl under the hood, but I also suspect each post call would create its own session. I don’t think it is possible to establish a single session to talk sequentially to lcserver; if so this would be too slow. Am I correct?
Actually I guess I could just use my present method using curl and shell() instead of post, but addressed to an .lc script instead of .php?
Or is there a whole better way to do what I want?
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode