improve https support on Windows

This commit is contained in:
Otto Mao
2015-03-30 17:39:23 +08:00
parent 68478cd162
commit d807c805dc
4 changed files with 53 additions and 6 deletions

27
cert/gen-cer.cmd Normal file
View File

@@ -0,0 +1,27 @@
@echo off
set domain=%1
set outputPath=%2
set commonname=%domain%
set country=ZH
set state=Shanghai
set locality=Shanghai
set organization=a.com
set organizationalunit=IT
set email=a@b.com
set password=a
echo Generating key request for %domain%
openssl genrsa -passout pass:%password% -out %domain%.key 2048
echo Removing passphrase from key
openssl rsa -in %domain%.key -passin pass:%password% -out %domain%.key
echo Creating CSR
openssl req -new -key %domain%.key -out %domain%.csr -passin pass:%password% -subj /C=%country%/ST=%state%/L=%locality%/O=%organization%/OU=%organizationalunit%/CN=%commonname%/emailAddress=%email%
openssl x509 -req -days 3650 -in %domain%.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out %domain%.crt
echo Finished

12
cert/gen-rootCA.cmd Normal file
View File

@@ -0,0 +1,12 @@
@echo off
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -days 3650 -out rootCA.crt -subj "/C=CN/ST=SH/L=SH/O=AnyProxy/OU=Section/CN=Anyproxy SSL Proxying/emailAddress=AnyProxy@AnyProxy"
echo =============
echo rootCA generated at :
echo %cd%
echo =============
start .
rem exit 0