Put in this file the following code:
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
[req_distinguished_name]
commonName = mydomain.com
commonName_max = 64
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = mydomain.com
DNS.2 = *.mydomain.com
- To create the Private key:
sudo openssl genrsa -out server.key 2048
- To create
Certificate Signing Request
(CSR):
sudo openssl req -new -out server.csr -key server.key -config openssl.cnf
Input the CN on the terminal, the same domain that you put in the openssl.cnf
file.
- To sign the SSL Certificate:
sudo openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf