liaohandel / node-express-https

Example of using Express & Node.js with HTTPS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-express-https

Example of using Express & Node.js with HTTPS.

Usage

Install dependencies :

npm install

Then launch the app.js file with node :

node app.js

You can then access the server on the address : https://127.0.0.1:8443/

Generate the certificate

The certificate files are stored inside the ssl/ folder. You can generate new files with the following commands.

Create the private key :

openssl genrsa -out key.pem 1024

Create the "Certificate Signing Request" :

openssl req -new -key key.pem -out csr.pem

Create the self-signed certificate :

openssl x509 -req -in csr.pem -signkey key.pem -out cert.pem

Alternatively you can send the CSR to a Certificate Authority for signing.

About

Example of using Express & Node.js with HTTPS.


Languages

Language:JavaScript 100.0%