Skip to content

Instantly share code, notes, and snippets.

@Tynael
Created November 29, 2023 16:13
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 Tynael/031fada372159dac75e3ca2d0f8fc875 to your computer and use it in GitHub Desktop.
Save Tynael/031fada372159dac75e3ca2d0f8fc875 to your computer and use it in GitHub Desktop.
makecert.bat used in XAMPP to create a self-signed SSL certificate
@echo off
set OPENSSL_CONF=./conf/openssl.cnf
if not exist .\conf\ssl.crt mkdir .\conf\ssl.crt
if not exist .\conf\ssl.key mkdir .\conf\ssl.key
bin\openssl req -new -out server.csr
bin\openssl rsa -in privkey.pem -out server.key
bin\openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 1825 -extfile v3.ext
set OPENSSL_CONF=
del .rnd
del privkey.pem
del server.csr
move /y server.crt .\conf\ssl.crt
move /y server.key .\conf\ssl.key
echo.
echo -----
echo Das Zertifikat wurde erstellt.
echo The certificate was provided.
echo.
pause
@Tynael
Copy link
Author

Tynael commented Nov 29, 2023

The v3.ext file can be found here.

Examples used in https://neutrondev.com/how-to-set-up-ssl-certificate-localhost-xampp/

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