Enabling a secure connection on my locahost through Apache.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Enabling a secure connection on my locahost through Apache.

Postby Food_Booth » 05. April 2022 23:56

I've been trying to figure out how to have a secure connection via HTTPS on my localhost:8080 website. I've watched tutorials and guides but I can't seem to get the result I'm after. I'm curious whether I'm doing something wrong or whether I'm hosting my website incorrectly.

I'm using the XAMPP web server and hosting my website through Apache (htdocs etc) however my website can't seem to either have a valid SSL or a secure connection.
Food_Booth
 
Posts: 1
Joined: 05. April 2022 23:48
XAMPP version: 3.3.0
Operating System: Windows

Re: Enabling a secure connection on my locahost through Apac

Postby Nobbie » 06. April 2022 10:15

And what did you do for it?
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04

Re: Enabling a secure connection on my locahost through Apac

Postby VipulK » 06. December 2022 07:03

Same here. The guides don't seem right, they ask you to download a .bat file and execute it to generate certificates. Windows can do that without additional scripts, I don't trust them to execute .bat files from the internet. I was wondering if there is an official guide from apache friends on how to get https://localhost working since its such a common need case?
VipulK
 
Posts: 1
Joined: 06. December 2022 06:36
XAMPP version: 3.3.0
Operating System: Windows 11

Re: Enabling a secure connection on my locahost through Apac

Postby Nobbie » 07. December 2022 14:41

VipulK wrote:I don't trust them to execute .bat files from the internet.


Why not? A .bat file is a plain textfile which contains common Windows commands. You may simply edit the files and see, what they are doing. Its not a compiled .exe or so. The Xampp makecrt.bat does not contain many lines, its more or less a call to the openssl.exe program with certain parameters. Nothing to fear about.
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04

Re: Enabling a secure connection on my locahost through Apac

Postby Froosh » 07. December 2022 15:02

I agree with Nobbie. Batch scripts are just simple text files. You can download them, examine the content to be sure what they are doing, and run them. Sure, people have done all sorts of things, good and bad, with batch scripts. Know your source and what the script does, and you are fine.

I've successfully setup https locally with Apache under XAMPP. Creating the certificate was probably the easier part. Getting the rest of the configuration correct took more effort. What I found was that Apache configuration approach, with regards to what configuration file does what, have changed over time in terms of where certain settings should go, but the settings involved are the same or similar. I got https to work, but more as an exercise, as on localhost, it provides, in my situation, no real value.

If you really want https working, don't blanket disregard/fear bacth files, and do some research regarding configuration of Apache and https. I do not recall all the steps I took at this time, as it has been a while.
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 118 guests