Last active
January 1, 2022 20:23
-
-
Save xPaw/840f378f3fed64806b46211c2287b52c to your computer and use it in GitHub Desktop.
Localhost certificate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
openssl ecparam -name prime256v1 -genkey -out localhost.key | |
openssl req -new -x509 -days 7300 -out localhost.crt -key localhost.key \ | |
-subj '/CN=localhost' -extensions EXT -config <( \ | |
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost, DNS:*.localhost, IP:127.0.0.1, IP:::1\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") | |
openssl dhparam -out dhparam.pem 4096 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment