HTTPS Server with OpenSSL Key Generation
sudo apt-get install node
sudo apt-get install openssl
brew install node
brew install openssl
git clone https://github.com/prasantmahato/https_server.git
cd /https_server
npm install
node index.js
Commands to generate Keys
- Generate a new private key
openssl genpkey -algorithm RSA -out private-key.pem
- Generate a certificate signing request (CSR) for an existing private key
openssl req -new -key private-key.pem -out csr.pem
- Generate a certificate signing request based on an existing certificate
openssl x509 -req -days 365 -in csr.pem -signkey private-key.pem -out certificate.pem
curl -X POST https://localhost:443 --insecure \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'username=Batman' -d 'password=MEN_ARE_BRAVE'
- Using --insecure flag as it a locally generated self-signed certificate