Generating keys...

Scripts to manage certificates or generate config files

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
riahc3
OpenVPN User
Posts: 46
Joined: Tue Jun 26, 2012 9:04 am

Generating keys...

Post by riahc3 » Fri Nov 28, 2014 8:38 am

Hello

Im trying to generate a server key and Im trying this:

openssl req -days 3650 -batch -new -keyout /my-ca/companysrv.key -out /my-ca/companysrv.csr -notes -extensions server -config

But it seems that there is something missing....

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Generating keys...

Post by maikcat » Fri Nov 28, 2014 9:46 am

there are 2 commands which must executed,
first you create a csr THEN sign it

Code: Select all

openssl req -days 3650 -nodes -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -extensions server -config %KEY_CONFIG%
Michael.

riahc3
OpenVPN User
Posts: 46
Joined: Tue Jun 26, 2012 9:04 am

Re: Generating keys...

Post by riahc3 » Fri Nov 28, 2014 10:40 am

What is "%KEY_CONFIG%"?

riahc3
OpenVPN User
Posts: 46
Joined: Tue Jun 26, 2012 9:04 am

Re: Generating keys...

Post by riahc3 » Fri Nov 28, 2014 10:47 am

Code: Select all

openssl req -days 3650 -nodes -new -keyout /company-ca/companysvr.key -out /company-ca/companysvr.csr -config companySVR.conf
Putting that line results in:

Code: Select all

error on line -1 of companySVR.conf
3073799868:error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('companySVR.conf','rb')
3073799868:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:172:
3073799868:error:0E078072:configuration file routines:DEF_LOAD:no such file:conf_def.c:197:

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Generating keys...

Post by maikcat » Fri Nov 28, 2014 11:30 am

key config is openssl.cnf

can you post the contents of companySVR.conf?

Michael.

Post Reply