Menu

[b70fdb]: / windows / Generate_certs.cmd  Maximize  Restore  History

Download this file

59 lines (47 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
echo ADCH++ Certifcation Generator
echo.
echo This script requires the newest Win32-OpenSSL binaries to be installed.
echo Available from https://slproweb.com/products/Win32OpenSSL.html
echo.
set SSL=C:\OpenSSL-Win32\bin\openssl.exe
if not exist %SSL% (
echo OpenSSL isn't found in %SSL%
set SSL="%PROGRAMFILES%\OpenSSL-Win32\bin\openssl.exe"
)
if not exist %SSL% (
echo OpenSSL isn't found in %SSL%
set SSL="%PROGRAMFILES(X86)%\OpenSSL-Win32\bin\openssl.exe"
)
if not exist %SSL% (
echo OpenSSL isn't found in %SSL%
set SSL="%PROGRAMFILES%\OpenSSL-Win64\bin\openssl.exe"
)
if not exist %SSL% (
echo.
echo OpenSSL isn't found in %SSL%, exiting...
pause
exit
)
echo.
echo OpenSSL is found in %SSL%
pause
if not exist .\config goto notfound
if exist .\adchppd.exe goto found
:notfound
echo This script must be run from the ADCH++ program folder...
goto end
:found
echo Proceeding with key generation...
call %SSL% genrsa -out privkey.pem 2048
cls
call %SSL% dhparam -outform PEM -out dhparam.pem 2048
cls
call %SSL% req -new -x509 -key privkey.pem -out cacert.pem -days 1095
mkdir certs
cd certs
mkdir trusted
cd..
move *.pem certs\
:end
pause
MongoDB Logo MongoDB