Skip to content

Instantly share code, notes, and snippets.

@nkmathew
Created March 23, 2017 16:47
Show Gist options
  • Save nkmathew/126694c5246749bb2dd751eb9c7fde4d to your computer and use it in GitHub Desktop.
Save nkmathew/126694c5246749bb2dd751eb9c7fde4d to your computer and use it in GitHub Desktop.
Self-signed localhost openssl certificate
#!/usr/bin/env bash
# Generates a self-signed localhost certificate. Don't forget to restart the browser
# if it doesn't work the first time(certificate caching)
sitename=$1
openssl req -config openssl.cnf -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout $sitename.key -out $sitename.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment