Following are Steps to setup HTTPS for XAMP;
Download and install XAMPP Here
Navigate to
C:\xampp\apache\conf\extra
Open httpd-vhosts-conf file in Notepad
add a VIRTUALHOST in the end by copying following code
# Virtual Hosts
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<Directory "C:/xampp/htdocs/">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
ServerName will be the URL you want to setup HTTPS on; In this case We are using localhost
Now We will create Private KEY. Navigate to the directory C:\xampp\apache.
Open makecert.bat
. It will ask Pass Phrase and some questions. You can give answers of your choices but the comman name should be the URL for which you are setting up SSL for; in this case its "localhost".
Once done with it you can find the certificates and Key folder in the following directory
C:\xampp\apache\conf
Now, Navigate to C:\xampp\apache\conf
. We will be configuring our httpd.config
file,
All we need to do is to include following lines in the very bottm of httpd.config
file.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Now, Open ssl.crt
folder and Install the certificate on the local machine by follwing steps;]
- open
server.crt
- click **install certificate""
- click local machine, then proceed next
- click on **Place all certificates in the following store"
- Browse and Choose Trusted Root Certification Authorities, click OK and NEXT
- Click Finish
A message will pop up saying ""the import was successfull""
We will enable Allow invalid certificates for resources loaded from localhost. in Chrome.
for this paste the following on URL, it will lead you directly to it.
chrome://flags/#allow-insecure-localhost
Restart your XAMPP services and restart chrome as well.
You should now be able to access your website with HTTPS / SSL enabled.
https://support.google.com/chrome/thread/241869686/allow-insecure-localhost-has-been-removed-as-of-chrome-119?hl=en