Skip to content

Instantly share code, notes, and snippets.

@airways
Forked from turtlepod/make-cert.bat
Last active May 2, 2024 14:25
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
@LeoSeyers
Copy link

Thank you @airways, it helped :) 💯

@dimaslanjaka
Copy link

where to put the file. my xampp in D:\xampp

@mindfulvector
Copy link

This script is updated based on the article here, which gives all the other information for the process:
https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/

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