Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate a multi domains certificate using config files
Steps (en ligne de commande - macosx):
- `cd Desktop/`
- `openssl genrsa -out mmw.key 2048`
- `openssl req -new -out server.csr -key server.key -config openssl.cnf`
- `openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server_autosign_test.crt -extensions v3_req -extfile openssl.cnf` _(autosigné, afin de vérifier la génération)_
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
[req_distinguished_name]
countryName = Country Name (2 letter code)
countryName_default = FR
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Paris
localityName = Locality Name (eg, city)
localityName_default = Montrouge
organizationName = Organization Name (eg, company)
organizationName_default = Maboite
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = IT
streetAddress= Street address
streetAddress_default= 6 Rue des renards enchainés
postalCode= Postal Code
postalCode_default= 94320
commonName = Common Name (eg, your name or your server's hostname)
commonName_default = domain1.com
commonName_max = 64
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = domain1.com
DNS.2 = domain2.com
DNS.3 = domain3.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment