Skip to content

Instantly share code, notes, and snippets.

@Himura2la
Created January 10, 2024 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Himura2la/505ac27548e3f7aa0235c9f12bbfea1b to your computer and use it in GitHub Desktop.
Save Himura2la/505ac27548e3f7aa0235c9f12bbfea1b to your computer and use it in GitHub Desktop.
Generate your own TLS certificate chains
# CA
openssl ecparam -genkey -name prime256v1 -out ca.key
cat > ca.conf <<EOF
[req]
prompt = no
x509_extensions = ext
distinguished_name = dn
[ext]
keyUsage = critical,keyCertSign,cRLSign
basicConstraints = critical,CA:TRUE,pathlen:0
[dn]
C = XX
ST = State
L = City
O = Organization
OU = Organizational Unit
CN = example.com
EOF
openssl req -new -x509 -nodes \
-days 3650 \
-key ca.key \
-out ca.crt \
-config ca.conf
openssl x509 -text -noout -in ca.crt
@Himura2la
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment