Skip to content

Instantly share code, notes, and snippets.

@mangelsnc
Created March 15, 2018 09:15
Show Gist options
  • Save mangelsnc/b9ebe649f500ef0c5c26b531b77788a6 to your computer and use it in GitHub Desktop.
Save mangelsnc/b9ebe649f500ef0c5c26b531b77788a6 to your computer and use it in GitHub Desktop.
Autogenerated SSL Wildcard certificate
cat > openssl.cnf <<-EOF
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = *.domain.dev
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = *.domain.dev
DNS.2 = domain.dev
EOF
openssl req \
-new \
-newkey rsa:2048 \
-sha1 \
-days 3650 \
-nodes \
-x509 \
-keyout domain.dev.key \
-out domain.dev.crt \
-config openssl.cnf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment