Skip to content

Instantly share code, notes, and snippets.

Created Oct 2, 2016
What would you like to do?
Generate Self Signed SSL and added it as Trusted Root on OSX
#!/usr/bin/env bash
${OPENSSL} genrsa -out ${CERTPATH}/app-wildcard.key 2048
${OPENSSL} req -new -out ${CERTPATH}/app-wildcard.csr -key ${CERTPATH}/app-wildcard.key -config openssl.cnf
${OPENSSL} x509 -req -days 3650 -in ${CERTPATH}/app-wildcard.csr -signkey ${CERTPATH}/app-wildcard.key -out ${CERTPATH}/app-wildcard.crt -extfile openssl.cnf -extensions v3_req
sudo security delete-certificate -c "*.app"
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ${CERTPATH}/app-wildcard.crt
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
commonName = *.app
countryName = US
stateOrProvinceName = AL
localityName = Huntsville
organizationName = Example LLC
organizationalUnitName = IT
emailAddress =
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
DNS.1 =
DNS.2 =
IP.1 =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment