Generate SSL with Openssl and run node on https
Run Command from Powershell Administrator Mode openssl req -nodes -new -x509 -keyout server.key -out server.cert
The above command will prompt for few questions:
- Enter Country Name - can leave blank
- Enter state or province - can leave blank
- Enter city - can leave blank
- Organization Name - can leave blank
- Common Name - localhost (*mandatory)
- Email Address - can leave blank
After successful execution, you have 2 files in the folder where you ran the above command 1. server.cert is the self-signed certificate file 2. server.key is the private key of the certificate
https://localhost:3000/greeting
If openssl is not installed, the user can install from chocolatey by executing the command:
chocolatey install openssl