i am afraid mybe its not completely relevant for this forum but i am posting it here, as its the most helpful forum.
I was sending data from my raspberry pi (client) to my remote server via mqtts (8883). On the server side I have installed TLS to secure the mqtt. On the client side node-red is installed, and i am using the server adress (mqtts://example.server.de) and port 8883. One of my friend helped me to check the encryption, he told me now your data is encryped.
Now I want to use esp32 and i will have to use library PubSubClient to send the data directly to my server (example.server.de). In this library if i give only IP of the server only instead of mqtts://IP
IPAddress server(172, 16, 0, 2); // just is an example
Then perhaps my data from esp32 to server would not be encryped and man in the middle would be able to sniff the credentials (as I have set user and password on server side, only who have these can send the data to the server via mqtts). Once the man in the middle has credentials , then i am afraid , he can damage my server.
Please help me. How can i secure this using this esp32. Previously i was usig raspi zero W, but i want to replace raspi zero with esp32 because of high power consumption of raspi.