Generate Certificate Request CSR with SANs using OpenSSL command

Create: san.cfg

  
[ req ]
default_bits       = 2048
distinguished_name = req_distinguished_name
req_extensions     = req_ext
prompt             = no
[ req_distinguished_name ]
countryName                = Country Name (2 letter code)
stateOrProvinceName        = State or Province Name (full name)
localityName               = Locality Name (eg, city)
organizationName           = Organization Name (eg, company)
commonName                 = Common Name (e.g. server FQDN or YOUR name)
[ req_ext ]
subjectAltName = @alt_names
[alt_names]
DNS.1   = bla1.com
DNS.2   = bla2.com
DNS.3   = bla3.com

Run Command: 

openssl req -out sslcert.csr -newkey rsa:2048 -nodes -keyout private.key -config san.cnf

Verify your CSR command:

openssl req -noout -text -in sslcert.csr

Viet Luu has written 152 articles

Leave a Reply