Skip to content

Instantly share code, notes, and snippets.

@grumpysi
Created March 16, 2022 11:20
Show Gist options
  • Save grumpysi/8754c3107a039e3d1f387f20b6c6210a to your computer and use it in GitHub Desktop.
Save grumpysi/8754c3107a039e3d1f387f20b6c6210a to your computer and use it in GitHub Desktop.
Create a self signed local certificate for localhost development.
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