Skip to content

Commit

Permalink
add SSL generation scripts for windows, #4
Browse files Browse the repository at this point in the history
  • Loading branch information
pcnate committed Nov 6, 2018
1 parent 0f73137 commit c870b16
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
24 changes: 24 additions & 0 deletions SSL/CreateCARoot.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@echo off

:: set path
SET PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64

echo generate root cert
makecert.exe ^
-n "CN=CARoot" ^
-sr LocalMachine ^
-ss Root ^
-r ^
-pe ^
-a sha512 ^
-len 4096 ^
-cy authority ^
-sv CARoot.pvk ^
CARoot.cer

:: convert pvk to pfx
pvk2pfx.exe ^
-pvk CARoot.pvk ^
-spc CARoot.cer ^
-pfx CARoot.pfx ^
-po Test123
25 changes: 25 additions & 0 deletions SSL/CreateSslClientCert.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@echo off

:: set path
SET PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64

echo generate client cert
makecert.exe ^
-n "CN=ClientCert" ^
-iv CARoot.pvk ^
-ic CARoot.cer ^
-pe ^
-a sha512 ^
-len 4096 ^
-b 01/01/2014 ^
-e 01/01/2016 ^
-sky exchange ^
-eku 1.3.6.1.5.5.7.3.2 ^
-sv ClientCert.pvk ^
ClientCert.cer

pvk2pfx.exe ^
-pvk ClientCert.pvk ^
-spc ClientCert.cer ^
-pfx ClientCert.pfx ^
-po Test123
29 changes: 29 additions & 0 deletions SSL/CreateSslServerCert.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@echo off

:: set path
SET PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64

:: short expiration incose this doesn't get updated for future security issues
echo generate localhost server SSL cert
makecert.exe ^
-n "CN=localhost" ^
-iv CARoot.pvk ^
-ic CARoot.cer ^
-sr CurrentUser ^
-ss My ^
-pe ^
-a sha512 ^
-len 4096 ^
-b 01/01/2018 ^
-e 01/01/2020 ^
-sky exchange ^
-eku 1.3.6.1.5.5.7.3.1 ^
-sv ServerSSL.pvk ^
ServerSSL.cer


pvk2pfx.exe ^
-pvk ServerSSL.pvk ^
-spc ServerSSL.cer ^
-pfx ServerSSL.pfx ^
-po Test123
5 changes: 5 additions & 0 deletions SSL/generateSSL.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

CALL CreateCARoot.bat
CALL CreateSslClientCert.bat
CALL CreateSslServerCert.bat

0 comments on commit c870b16

Please sign in to comment.