When using a commercial Certificate Authority, generating a csr for the common name www.mysite.com
and sending it to them will result in a certificate being issued that works for both www.mysite.com
and mysite.com
.
The signing request is a single name request- just www.mysite.com
, so nothing special happens at the csr level:
openssl genrsa -des3 -out mysite.com.key 4096
openssl req -new -key mysite.com.key -out mysite.com.csr
common name, ie your name: www.mysite.com
But what comes back from the commercial CA is a certificate that works on both www and non-www.
Question: How can I take a csr that is just for www.mysite.com
and, using openssl with my own certificate authority, issue a certificate that works for both www.mysite.com
and mysite.com
, just like the commercial companies do?
I know you can modify the csr to add multiple domains with a config file, but only the www version is needed in the csr when using a commercial company. No multi-domain config files are necessary.
Are the commercial CAs modifying the submitted csr to include both versions? Or is there a flag in the signing command that makes the www
optional?
Can I modify this command to add both www and non-www versions, without changing the csr?
openssl x509 -req -days 365 -in mysite.com.csr -CA Authority.crt -CAkey Authority.key -set_serial 12345 -out mysite.com.crt
Or is there a simple way to add a second domain to a csr without a config file?
openssl req -new -key mysite.com.key -out mysite.com.csr
common name, ie your name: mysite.com, www.mysite.com