Skip to content

Instantly share code, notes, and snippets.

@mauriciomutte
Last active September 6, 2022 12:49
Show Gist options
  • Save mauriciomutte/10ba1ff12fa70e7b4f916911ce727372 to your computer and use it in GitHub Desktop.
Save mauriciomutte/10ba1ff12fa70e7b4f916911ce727372 to your computer and use it in GitHub Desktop.
Generate a self-signed SSL certificate using OpenSSL?
openssl req -x509 -out localhost.crt -keyout localhost.key \
-days 365 \
-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