Last active
March 21, 2021 21:25
-
-
Save grandsilence/9f3e92ba8fcc62356ff8e7d006072242 to your computer and use it in GitHub Desktop.
RUN AS ADMIN! Copy near generate.bat (OSPanel\modules\http\<YOUR SETUP>\conf)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set OPENSSL_CONF=%~dp0..\conf\openssl.cnf | |
..\bin\openssl req -x509 -sha256 -newkey rsa:2048 -nodes -days 5475 -keyout rootCA.key -out rootCA.crt -subj "/CN=OSPanel/" | |
..\bin\openssl req -newkey rsa:2048 -nodes -days 5475 -keyout server.key -out server.csr -subj "/CN=PhpStorm/" | |
..\bin\openssl x509 -req -sha256 -days 5475 -in server.csr -extfile v3.txt -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server.crt | |
..\bin\openssl dhparam -out dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
title Copy to userdata and install certs | |
set CURRENTDIR=%~dp0 | |
set OSPATH=%CURRENTDIR%..\..\..\..\userdata\config\cert_files | |
xcopy /y "%CURRENTDIR%dhparam.pem" "%OSPATH%" | |
xcopy /y "%CURRENTDIR%rootCA.crt" "%OSPATH%" | |
xcopy /y "%CURRENTDIR%rootCA.key" "%OSPATH%" | |
xcopy /y "%CURRENTDIR%rootCA.srl" "%OSPATH%" | |
xcopy /y "%CURRENTDIR%server.crt" "%OSPATH%" | |
xcopy /y "%CURRENTDIR%server.csr" "%OSPATH%" | |
xcopy /y "%CURRENTDIR%server.key" "%OSPATH%" | |
certutil -enterprise -f -v -AddStore "Root" "%OSPATH%\rootCA.crt" | |
certutil -enterprise -f -v -AddStore "Root" "%OSPATH%\server.crt" | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nsComment = "Open Server Panel Generated Certificate" | |
basicConstraints = CA:false | |
subjectKeyIdentifier = hash | |
authorityKeyIdentifier = keyid,issuer | |
keyUsage = nonRepudiation, digitalSignature, keyEncipherment | |
subjectAltName = @alt_names | |
[alt_names] | |
DNS.1 = localhost | |
DNS.2 = yoursite.loc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment