Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cheeaun/bcb80b1219b26df668f4987cd477849a to your computer and use it in GitHub Desktop.
Save cheeaun/bcb80b1219b26df668f4987cd477849a to your computer and use it in GitHub Desktop.
Set up local static file server with HTTPS

Set up local static file server with HTTPS

  • npm i http-server -g - global install the static file server
  • openssl genrsa -des3 -out key.pem 1024
  • openssl req -new -key key.pem -out csr.pem
  • cp key.pem key.pem.org
  • openssl rsa -in key.pem.org -out key.pem
  • openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
  • http-server . --S in the root directory

Found via:

@msankhala
Copy link

I followed the steps but it is showing invalid certificate warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment