Created
January 10, 2024 12:30
-
-
Save Himura2la/505ac27548e3f7aa0235c9f12bbfea1b to your computer and use it in GitHub Desktop.
Generate your own TLS certificate chains
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
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Leaf certs generation: https://gitlab.com/himura/ansible/-/blob/main/roles/nomad/gen-cert.sh