Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 408 Bytes

File metadata and controls

30 lines (20 loc) · 408 Bytes

HTTPS example

Simple HTTPS server using tinyhttp and https module.

Setup

Generate the certificate key:

openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \
  -keyout localhost-privkey.pem -out localhost-cert.pem

Install dependencies:

tinyhttp new https

Run

node index.js

and in another terminal:

curl https://localhost:3000 -k