Encrypt Socket communication
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 130
- Joined: Fri Apr 13, 2018 1:53 pm
Encrypt Socket communication
Dear all,
I have a working multi Platform application:
Android (open socket) <-> Windows (accept communication) <-> Windows (open socket)
All three systems can communicate with a normal TCP Socket connection to the server in the middle. There I receive read and write request and store infomations in a database.
But what can I do to encrypt the complete TCP traffic?
Android <- read/write encrypt -> Windows <-read/write encrypt -> Windows
I think that I have to include the openSSL Library on all three systems and that I have to create a certificate on the middle server - Right? And then? I can not find documentation about this...
Regs
Stef
I have a working multi Platform application:
Android (open socket) <-> Windows (accept communication) <-> Windows (open socket)
All three systems can communicate with a normal TCP Socket connection to the server in the middle. There I receive read and write request and store infomations in a database.
But what can I do to encrypt the complete TCP traffic?
Android <- read/write encrypt -> Windows <-read/write encrypt -> Windows
I think that I have to include the openSSL Library on all three systems and that I have to create a certificate on the middle server - Right? And then? I can not find documentation about this...
Regs
Stef
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Encrypt Socket communication
See the "secure" option for the "open socket" command, e.g. "open secure socket to...":
https://livecode.com/resources/api/#liv ... pen_socket
That said, unless you absolutely need a custom protocol you may find use HTTPS simpler for a great many tasks.
https://livecode.com/resources/api/#liv ... pen_socket
That said, unless you absolutely need a custom protocol you may find use HTTPS simpler for a great many tasks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 130
- Joined: Fri Apr 13, 2018 1:53 pm
Re: Encrypt Socket communication
Hi Richard,
I have installed a Lets encrypt certificate on the Server in the middle
Remember:
Android (open socket) <-> Windows w. Certificate (accept communication) <-> Windows (open socket)
I start from the Mobile Device (left) the communication:
And then I receive a Timeout... I dont know why..
Can it be that there is also a secure necessary in the write command??
btw, I am working with Sockets because I dont know how to work with https :-p maybe if you can give me a short starting point how to send/receive with https it is possible to change this in my application
I have installed a Lets encrypt certificate on the Server in the middle
Remember:
Android (open socket) <-> Windows w. Certificate (accept communication) <-> Windows (open socket)
I start from the Mobile Device (left) the communication:
Code: Select all
put "myhost.de:9999" into sock_server
open secure socket to sock_server with message "wasConnected" without verification
Can it be that there is also a secure necessary in the write command??
Code: Select all
write var_username & "$*$" & var_passwort & "$*$***EOL" to socket sock_server
btw, I am working with Sockets because I dont know how to work with https :-p maybe if you can give me a short starting point how to send/receive with https it is possible to change this in my application
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Encrypt Socket communication
I'm having a mad love affair with HTTP lately, so you caught me in the right mood for that.ace16vitamine wrote: ↑Fri Jun 26, 2020 12:59 ambtw, I am working with Sockets because I dont know how to work with https :-p maybe if you can give me a short starting point how to send/receive with https it is possible to change this in my application
Let's begin at the beginning: what's on the server that you're looking to deliver to your app?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 130
- Joined: Fri Apr 13, 2018 1:53 pm
Re: Encrypt Socket communication
Only informations out of a database. We convert this into JSON Format and transfer it over socket.
Today the Socket communication is
A= Android
B=Win Server in the middle
C=Win Server right
C -> B Authentication
B -> C Result of Authentication
C -> B Send extract from his own DB with JSON format
-----
A -> B Authentication
B -> A Result of Authentication
B -> A Send extract from DB with JSON format
Today the Socket communication is
A= Android
B=Win Server in the middle
C=Win Server right
C -> B Authentication
B -> C Result of Authentication
C -> B Send extract from his own DB with JSON format
-----
A -> B Authentication
B -> A Result of Authentication
B -> A Send extract from DB with JSON format