-
-
Save turtlepod/e94928cddbfc46cfbaf8c3e5856577d0 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% | |
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 3650 -out %domain%\server.crt | |
echo. | |
echo ----- | |
echo The certificate was provided. | |
echo. | |
pause |
Posted a revision for the current version of XAMPP: https://gist.github.com/airways/ae67310727ac394e5b3c12ba9f918962
I have forked a new revision with a piece of code that avoids replacing the source cert.conf file when creating a new certificate. https://gist.github.com/ifranco88/50c4b4a5a86613f09ad573c2dfe69619
Please set your path at line 3. set OPENSSL_CONF=../conf/openssl.cnf according to your directory.
I just updated my path and it worked best.
I fixed my issue by fixing two paths of openssl for my Xampp with PHP 7.4 at C:/xampp
with this file located at C:/xampp/cert/make-cert.bat
set OPENSSL_CONF=../apache/conf/openssl.cnf
..\apache\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 365 -out %domain%\server.crt
Hello everyone, here is the solution for your problem:
https://gist.github.com/TheClio69/d7ea7477cf3f28f304ab02f545b6ec96
What has been changed? Two paths have been changed (for more information see the gist).
I published this solution 4 months ago on my github, but forgot to send it here, which is why I am sending this message so late.
where cert.conf
came from ?
cert.conf
is created in this article which the script is based on: https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/
Dude! Thank you so much! I was searching everywhere for a fix for this. I couldn't create a key with openSSL using git bash and was losing my mind. This literally took me 5 minutes. You rock!