Skip to content

Instantly share code, notes, and snippets.

@airways

airways/make-cert.bat

Forked from turtlepod/make-cert.bat
Last active Oct 13, 2020
Embed
What would you like to do?
@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

This comment has been minimized.

Copy link
Owner Author

@airways airways commented Aug 2, 2020

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

@airways

This comment has been minimized.

Copy link
Owner Author

@airways 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

This comment has been minimized.

Copy link

@LeoSeyers LeoSeyers commented Oct 13, 2020

Thank you @airways, it helped :) 💯

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