Configuration file (csr.conf) [req] default_bits = 2048 distinguished_name = dn prompt = no default_md = sha1 [dn] C="CA" ST="BC" L="Vancouver" O="Dev Inc" OU="Dev" emailAddress="webmaster@localhost" CN="dev.localhost" [req_ext] subjectAltName = @alt_names [alt_names] DNS.0 = *.dev.localhost Commands openssl genrsa -out self-ssl.key openssl req -new -key self-ssl.key -out self-ssl.csr -config csr.conf openssl x509 -req -days 3650 -in self-ssl.csr -signkey self-ssl.key -out self-ssl.crt -extensions req_ext -extfile csr.conf