Page 1 of 1

STR_COPY:variable has no value

Posted: Sun Feb 26, 2012 11:05 pm
by spaza
I'm trying to finish creating certificates by following the HOWTO http://openvpn.net/index.php/open-sourc ... o.html#pki

And I keep getting this error when using build-ca:
Image

This is on a Windows 7 64bit machine. I had to create the openssl\ssl\ directory and put in the openssl.cnf file from openvpn to get around another error where it was trying to open the cnf file from the former non existant directory.

Re: STR_COPY:variable has no value

Posted: Mon Feb 27, 2012 10:04 am
by janjust
check the file 'openssl.cnf' , line 117; most likely it will read

Code: Select all

stateOrProvinceName_default = $ENV::KEY_PROVINCE
is this env var set in the 'vars' batch file?

Re: STR_COPY:variable has no value

Posted: Mon Feb 27, 2012 10:05 pm
by spaza
janjust wrote:check the file 'openssl.cnf' , line 117; most likely it will read

Code: Select all

stateOrProvinceName_default = $ENV::KEY_PROVINCE
is this env var set in the 'vars' batch file?

Yes:

set KEY_COUNTRY=US KEY_PROVINCE=WA KEY_CITY=xx KEY_ORG=HomeVPN KEY_EMAIL=xx@xx.com

Re: STR_COPY:variable has no value

Posted: Tue Feb 28, 2012 8:22 am
by janjust
you need to specify all of them separately (it's a DOS batch file):

Code: Select all

set KEY_COUNTRY=
set KEY_PROVINCE=...
after sourcing the vars.bat file, type

Code: Select all

echo %KEY_PROVINCE%
to ensure that it is set.

Re: STR_COPY:variable has no value

Posted: Thu Mar 01, 2012 2:38 am
by spaza
Ah, tyvm. The reason it wasn't working for me was that I went into the batch file Vars.bat and changed the text inside it.

Re: STR_COPY:variable has no value

Posted: Thu Mar 01, 2012 9:42 am
by janjust
you can do that as well, but sometimes the vars.bat has the wrong line feeds ; SET lines in a batch file need to be specified on separate lines, i.e.

Code: Select all

set KEY_COUNTRY=
set KEY_PROVINCE=...
etc . A single line SET A=B C=D does not work