Score:0

Why do i get openssl error unknown option for -adext?

cn flag

I am attempting to generate CSR using openssl with subject alternative names however i get an error stating no options for adext. See command below.. I am using OpenSSL 1.0.2k-fips

openssl req -new \
-newkey rsa:2048 -nodes -keyout {domain-name}.key \
-out {domain-name}.csr \
-subj "/C=GB/ST=test/L=/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"
Score:1
cn flag

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

cn flag
Thanks but i have just copied what you have there and it does not work... i did not miss out a "d", i actually have "addext" not "adext" in there. Also i think this is a version issue no ?
br flag
You've effectively answered your own question. While version 1.1.1 has the `-addext` option, [version 1.0.2 doesn't](https://web.archive.org/web/20210103034813/https://www.openssl.org/docs/man1.0.2/man1/openssl-req.html).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.