Generate a private key and CSR for multiple domains
generate csr with subject alternative names | openssl create key and csr one command | create certificate signing request linux | csr with www and non-www | openssl | csr | private-key | sanCaution: This command changes the system. Understand what it does before you run it.
openssl req -new -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr -subj "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:www.example.com"Creates an unencrypted 2048-bit RSA key and a CSR in the current directory, ready to submit to a certificate authority. -addext adds the domain and its www variant as Subject Alternative Names, which is mandatory today. Afterwards, store the key so that only root can read it.
Note: Existing files with the same name are overwritten without asking. -addext requires OpenSSL 1.1.1 or newer.
Also searched as
- generate csr with subject alternative names
- openssl create key and csr one command
- create certificate signing request linux
- csr with www and non-www