mercredi 29 mai 2019

Encrypting connection to a server without a domain name

On the product I'm building I'm using raspberry pi which has a running web server on it used to query the state of the device and issue various actions. I have configured the pi to be a wifi hotspot and I'm connecting to it via a mobile device which is running the client application which I'm also developing using cordova. The app connects to the web server easily by looking at the gateway address which will always be the pi's IP address.

I would like to encrypt the connection such that in the extremely unlikely event that someone would ever try to sniff the useless information going between the devices they wouldn't be able to and hence the problem I'm facing.

If I generate a self-signed certificate then the browser in the webview will complain. I'm pretty sure there is some kind of option in XMLHttpRequest or fetch that I can set so that the certificate will not be checked but doesn't that defeat the purpose of the whole thing?

In short, how can I encrypt a connection between the server and client when the server does not have a domain?




Aucun commentaire:

Enregistrer un commentaire