I have a config script that I use to give default values for my CSRs, obviously just specifying the FQDN I'm wanting to use. Generally the names will be like www.example.com
.
However for most of my domains I also want the SAN example.com
(ie no www
). At the moment I'm manually editing my config file to change the last line of to the relevant domain:
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = example.com
But I'm wondering if this can be somehow left blank, and then the script prompt to ask for the alt_name(s) when running? I run something like:
sudo openssl req -new -sha256 -key example-com.key -out example-com.csr --config my-config-file.conf
Any pointers appreciated.
Thanks.