I have to create an application which generates a CSR. While generating a CSR we are required to fill in several details like CN, OU, etc. The problem is that the Certifying Authority to which I have to send my CSR wants 2 OU(Organizational Unit) Names. I googled a lot but couldn't find anything using either openssl or java keytool by which I can specify 2 OU Names.

Can someone please tell me how I can specify 2 OU Names while generating the CSR?

1 Answer 1


You can do this easily with openssl:

openssl req -new -out myserver.csr \
  -newkey rsa:2048 -sha1 -nodes -keyout myserver.key  \
  -subj "/C=US/ST=New York/L=New York/O=My Company/OU=1st OU/OU=2nd OU/CN=www.myserver.net"

(If you already have a key you wish to use, omit -newkey rsa:2048 -sha1 -nodes and use -key myserver.key instead of -keyout ...)

You can inspect the CSR before you submit it with:

openssl req -in myserver.csr  -noout -text

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .