Skip to content

Instantly share code, notes, and snippets.

@airways
Forked from turtlepod/make-cert.bat
Last active October 13, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save airways/ae67310727ac394e5b3c12ba9f918962 to your computer and use it in GitHub Desktop.
Save airways/ae67310727ac394e5b3c12ba9f918962 to your computer and use it in GitHub Desktop.
@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
set dir="%cd%"
cd ..\php
..\php\extras\openssl\openssl.exe req -config %dir%\cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %dir%\%domain%\server.key -x509 -days 365 -out %dir%\%domain%\server.crt
echo.
echo -----
echo The certificate was provided.
echo.
pause
@airways
Copy link
Author

airways commented Aug 2, 2020

Updated for current XAMPP 3.2.4 (2020/8/2) file layout.

@airways
Copy link
Author

airways commented Aug 2, 2020

Note: I also had to provide the full path to the files in the crt directory when creating the VirtualHost directive's SSLCertificateFile and SSLCertificateKeyFile values.

@LeoSeyers
Copy link

Thank you @airways, it helped :) 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment