I'm building a Flutter app that needs to send user data (like name and street) to a Node.js backend server. Currently, the data is sent via URL like this:
http://192.168.1.126:8080/save?name=toto&street=somestreet I want to make this communication secure.
Option 1:
TLS/HTTPS I followed this tutorial: https://www.geeksforgeeks.org/node-js/how-to-use-ssl-tls-with-node-js/ I managed to start a TLS server, but I'm not sure how to connect to it from Flutter.
Question: How can I make an HTTPS request from Flutter to my local Node.js server using a self-signed certificate?
Option 2:
RSA encryption Alternatively, I thought about encrypting the user data (name, street, etc.) with an RSA public key in Flutter, and decrypting it in Node.js using the private key. But I'm stuck on both sides:
I don’t know how to properly encode/encrypt a string in Flutter with a public key.
And I’m not sure how to decrypt it in Node.js.
Any help or working examples for either method would be appreciated!
http://in the URL tohttps://? Was there any error when you did that?https:on your link as @FrankvanPuffelen mentioned