Skip to content

Instantly share code, notes, and snippets.

@jcbohin
Created June 21, 2018 10:47
Show Gist options
  • Save jcbohin/c2c01427d7d3e00cf10c7b26c787dab3 to your computer and use it in GitHub Desktop.
Save jcbohin/c2c01427d7d3e00cf10c7b26c787dab3 to your computer and use it in GitHub Desktop.
Generate certificate for localhost
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment