On 01/27/2009 08:57 PM, Thor wrote:
Hi guys,

I'm wondering if its possible to pass parameters to openssl when creating a CSR, specifically the country name, state name, locality name, organization name, common name etc?

The reason being, I ideally would like to automate the process of creating a CSR and have it not require user input (other variables would be passed to it by default from an outside source).

Something like...

openssl req -days 3650 -nodes -new -keyout user.key -out user.csr -config -countryname SE -commonname user ...

Any help would be appreciated,

Thanks.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Thor,

Have you checked out the man pages for the req program? It seems you'd want the * -subj * flag.

http://www.openssl.org/docs/apps/req.html


Here's a sample generation

openssl req -nodes -newkey rsa:2048 -nodes -keyout myserver.key -out server.csr -subj "/C=GB/ST=Yorks/L=York/O=MyCompany Ltd./OU=IT/CN=mysubdomain.mydomain.com"

Hope this helps
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to