How to build a certificates chain of trust in Windows using `openssl`?

Certificates chain of trust

  1. Issue a root certificate
  2. Make the root certificate trusted by Windows
  3. Create a certificate signing request (CSR) for your subject
  4. Issue the leaf (end-entity) certificate for the given CSR using the root certificate.

My previous manual: How do I install a self-signed certificate to localhost?