I want only the PC or microcontroller that have certificate can connect my website and download firmware.
Lets see commonly used options.
We place a few assumptions
- You are using TLS (https).
- You have control over your web server (apache, nginx, .. whatever).
Basic authentication
The simplest option is using basic authentication. In this option the client sends its username and password as part of the request. Example httpd configuration. For other web servers, just search the documentation.
This is the simplest option and yet secure (while using https).
Downside is that you need to manage the clients' usernames and passwords (if you don't want to share the same credentials between multiple devices).
Client credentials
Client credential is a way to authenticate the client on the transport (SSL) level.
Advantage - you can allow access clients without the server having the client's private key.
Disadvantage - It is more complex process (you need to create client keypairs, optionally sign them with a certificate authority or trust the certificates explicitly, manage revocations, ...) Example Apache server configuration