One approach can be to use PKI. Major steps would be:
- Define your own CA by creating, create a self signed certificate for it.
- Make this certificate trusted by adding it to the trust store on every device. Thus, even if you update server certificate time to time, it will remain trusted, because it will be signed by your trusted CA.
- Create separate key pair and certificate for every device, it should be used for communication with the server.
- Register public key of every device on the server side. Based on this the server will authenticate client devices. The server will reject communication with any clients that have no public key, registered at the server. Besides, this will give you the possibility to prohibit access for some client devices if think they were compromised.
don't want human-interaction between devices and server
Yes, this will be fulfilled.
After installation app, this client device should be already
authenticated.
Installing a key pair on the device and pre-registering it on the server side will make them automatically authenticated when they establish connection to server.
Also want to avoid incorrect/fake devices.
The server will communicate only with clients whose public key is pre-registered on the server.