Why do i get openssl error unknown option for -adext?
The error implies you have a typo and missed a d
out of the command when you entered it the first time (-adext
!= -addext
).
If you take exactly what you've shown in the question and just remove all the {}
so it uses domain-name.com
as the domain, it fails because L=
needs a value, but if you add in a value it then works just fine:
$ openssl req -new \
> -newkey rsa:2048 -nodes -keyout domain-name.key \
> -out domain-name.csr \
> -subj "/C=GB/ST=test/L=foo/O=test/OU=test/CN=domain-name.com" \
> -addext "subjectAltName = DNS:first.domain-name.com,DNS:second.domain-name.com,DNS:third.domain-name.com,DNS:www.domain-name.com.com"
Generating a RSA private key
................+++++
...........................................+++++
writing new private key to 'domain-name.key'
-----
p.s. you also have an extra .com
on the end