diff --git a/monkey_island/windows/create_certificate.bat b/monkey_island/windows/create_certificate.bat index cd1aaaa58..0af3e9960 100644 --- a/monkey_island/windows/create_certificate.bat +++ b/monkey_island/windows/create_certificate.bat @@ -1,19 +1,18 @@ @echo off -SET OPENSSL_CONF=windows\openssl.cfg - IF [%1] == [] ( - set dir=%cd%\ + set mydir=%cd%\ ) ELSE ( - set dir=%1 - REM - Remove double quotes - - set dir=%dir:"=% + set mydir=%~1% ) -echo Monkey Island folder: %dir% +echo Monkey Island folder: %mydir% + +SET OPENSSL_CONF=%mydir%bin\openssl\openssl.cfg +copy "%mydir%windows\openssl.cfg" "%mydir%bin\openssl\openssl.cfg" @echo on -"%dir%bin\openssl\openssl.exe" genrsa -out "%dir%cc\server.key" 1024 -"%dir%bin\openssl\openssl.exe" req -new -config "%dir%bin\openssl\openssl.cfg" -key "%dir%cc\server.key" -out "%dir%cc\server.csr" -subj "/C=GB/ST=London/L=London/O=Global Security/OU=Monkey Department/CN=monkey.com" -"%dir%bin\openssl\openssl.exe" x509 -req -days 366 -in "%dir%cc\server.csr" -signkey "%dir%cc\server.key" -out "%dir%cc\server.crt" \ No newline at end of file +"%mydir%bin\openssl\openssl.exe" genrsa -out "%mydir%cc\server.key" 1024 +"%mydir%bin\openssl\openssl.exe" req -new -config "%mydir%bin\openssl\openssl.cfg" -key "%mydir%cc\server.key" -out "%mydir%cc\server.csr" -subj "/C=GB/ST=London/L=London/O=Global Security/OU=Monkey Department/CN=monkey.com" +"%mydir%bin\openssl\openssl.exe" x509 -req -days 366 -in "%mydir%cc\server.csr" -signkey "%mydir%cc\server.key" -out "%mydir%cc\server.crt" \ No newline at end of file