I am implementing a Local Websocket server in Express nodeJS. Data is sent from the front-end to the server by creating a new WebSocket(ws://<private_ip>:3000);
as soon as <private_ip>:3000
is opened in a phone browser. (notice the ws)
This Local Websocket server will not be hosted on a public server but only on personal machines e.g. your own windows/mac machine. The reasoning behind this is not related to this post and will be omitted.
I have a basic understanding of how certificates work. I know that self-signed certificates
are usually imported to the browser to be trusted. The goal is to use something like new WebSocket(wss://<private_ip>:3000);
at the client side (notice the wss).
I fail to understand how the socket client created by code will trust a self-signed certificate
, hence the question: is there a way to secure the connection/communication to/with a locally hosted Webserver