Jump to content

Enabled https for localhost, now I can't turn it off :(


OrganizedFellow
 Share

Recommended Posts

Through tinkering with Laragon on Win10, I learned how to enable HTTPS for my local dev environment. 

But then I decided to remove it - but I can't.
My dev projects (via VirtualHosts) work fine but when I run `gulp` with BrowserSync and it launches `https://localhost:3000/` instead of `http://localhost:3000/` and the error `This site can’t provide a secure connection` is displayed.
Previously before all this tinkering, my gulp command ran fine.

  • I re-added the commented lines back into my .htaccess file for my PW dev project
  • I removed the certificates in the Certificate Manager along with the keys under Laragon
  • I have shut down and uninstalled Laragan to make sure it was not affecting anything (reinstall later).
  • I went into `chrome://net-internals/#hsts` and under `Delete domain security policies` deleted localhost from the entries.

I am at a loss. I don't know what else to do ? 

Link to comment
Share on other sites

If you want to really disable SSL try deselecting it in Laragons Apache settings:

image.thumb.png.8d181d8782cac3b54f9ea06a8b528d12.png

But I would recommend to keep it activated, since many web features like geolocation only work in a HTTPS context.

Normally, when Chrome shows this error message, it provides an option to add an exception for this site, and then you can view it.

Link to comment
Share on other sites

Weird! (and annoying)

14 hours ago, OrganizedFellow said:

Through tinkering with Laragon on Win10, I learned how to enable HTTPS for my local dev environment. 

What did you do then?

Link to comment
Share on other sites

On 3/22/2019 at 6:44 PM, OrganizedFellow said:

Final solution, reset Windows.

Everything is backed up. Doing that now.

On Windows I regularly use Macrim Reflect Free to make an image of the OS and registry state before I make changes to the system, then when I don't like it I just slap the clean image on and have all changes reverted. Do look into https://www.macrium.com/reflectfree it will save you time and hassle. All the best.

Regarding not having https, I am not sure if that is a good way to go forward. I think Chrome even now has something built in that will either give you a warning in the console or hinder you from doing local work when you are not on https. Don't quote me on it, but the general motion is to do everything via https.

  • Like 2
Link to comment
Share on other sites

44 minutes ago, bernhard said:

Resetting Windows got a lot easier since I know www.ninite.com ? 

I am not sure ninite can revert to a previously created, possibly clean image of the OS and installed software and its settings.
Had a quick look, seems like one can tick the options and install all the stuff.
However once you have installed stuff and then installed one more app that messed up the whole OS I am not sure ninite can revert to a previous state of the OS.
Never used it so don't know, however I could not find anything about it on the website.

Often, when setup correctly and afterwards an OS image is made, it is not necessary to completely reset Windows.
Been there, done that, too many times.
Just slap the previous clean image on and all your OS and software and its settings and the registry are fine again.
Naturally given the image is clean. Takes about 2 - 5 minutes to revert to a previously made image.

So the best time to make a first image is right after you have installed Windows again.
Also it might be a good idea to format and clean the partition you are installing Windows to.
I used to do this with Gparted Live.
In fact I have a partition just for the OS and a separate partition for all data.
Like this I do not have to go into numerous folders on the OS partition to backup.
I just have my data on a partition that as nothing to do with the OS.
Also, not sure if you do this, but I never had internet access on while installing Windows.

  • Like 1
Link to comment
Share on other sites

Does it install stuff through a live stick/cd or does one need the OS to then install ninite to then have ninite install software? Also in case it has a live usb/sick version that can install stuff I guess it would need to be connected to the internet to get all the sources? I mean does ninite run on an empty partition without OS? If not, how could it be useful for resetting Windows?

Perhaps I misunderstand you. Its purpose is to install and update, not sure how that is handy for resetting the OS.
I guess it can be handy once the OS is restored, meaning freshly installed on an empty and formatted partition.
In that aspect, yes sure, I guess it can be useful.
Though only after firewall and anti-virus have been installed, still offline, with all rules in place.

Comes to mind, some of the software do have "oh while you install this we are also going to set your default bookmarks, default browser and slap on another anti-virus on your system", and that coming up during the install options. Would be great if ninite defaults to not choosing such options, i.e. not installing 3rd party apps.
Fingers crossed.

Link to comment
Share on other sites

16 minutes ago, happywire said:

some of the software do have "oh while you install this we are also going to set your default bookmarks, default browser and slap on another anti-virus on your system", and that coming up during the install options. Would be great if ninite defaults to not choosing such options, i.e. not installing 3rd party apps.

That's what it does and why it is great ? 

  • Like 1
Link to comment
Share on other sites

5 hours ago, happywire said:

Regarding not having https, I am not sure if that is a good way to go forward

The problem was that Windows was forcing HTTPS on my localhost server, this disabled all local development.

As for NINITE? That is a simple application for reinstalling needed Windows software. 

THANK YOU tremendously for the suggestion for Macrium. I have a regular Windows Restore set up but this is a good second solution. Thanks!

Link to comment
Share on other sites

On 3/25/2019 at 5:07 PM, OrganizedFellow said:

I have a regular Windows Restore set up but this is a good second solution.

Get https://gparted.org/livecd.php

Get Macrium Reflect Free and make sure you have the exe and store that on a USB stick etc.

Now there is 2 ways to go about it.
a) Have OS and your data on the same drive in different partitions or b) have separate drives for OS and data.
Having OS and data mixed is a bad idea. Especially with Windows. Been there, done that, don't do it.
Similar to web dev where you can have a decoupled frontend from a backend and hence let the client decide some time down the project to take a new frontend while the backend can be left intact.
https://www.coredna.com/blogs/headless-vs-decoupled-cms

If you opt to have 1 physical drive and have OS and data on there put in into your laptop/desktop and boot into Gparted.
It will work regardless of your chip/architecture.
Make two empty partitions, one for your OS and one for your data.
You should have C for the OS and D for your data.
For Windows to be able to be installed you will need a NTFS partition.
Going into details here is too much but generally what I do is format it to "cleared" first and set the flag to boot.
If I remember correctly then you can boot into Windows setup and it will recognize the partition as empty and install onto it.

Let Windows do the install, follow instructions and do not connect to the internet, turn WiFi and Ethernet off, also physically, pull all internet cables out of the box.
Once done with the install, do not touch anything.
Put the USB stick with Macrium Free in it and install it.
Then make a first clean image.
Store that image on the D partition.

Then go on to install drivers.
Each time after a driver is installed correctly make a new clean image.
Might take some time but will come in very handy later.

Once done with all the drivers get rid of the images that you made after each drive installation and only keep the image that you made right after Windows was installed and the latest one, right after the last driver was installed. You should now have 2 images, one default untouched Windows image and the 2nd one with all the drivers installed. Also, best to get the drivers BEFORE you go online, so from another machine and put those on the USB stick alongside Macrium Free.

Now, slowly and carefully go on to install the software you want.
After each install of a new app make a new OS image.
In the comments for the image you can write what you installed.
I go about it that I keep a list of what software is currently installed in that image in the comments.
Or just make a text file where you write what image has what installed.

Make sure to decouple your Documents/Pictures/Videos/Music/Downloads from the C (OS) partition and link those to folders on your D (data) partition.
Done. Like this you should be fine going forward.
Sure there are some settings and the registry being stored to C, for that you have the clean images.

Now when you change things in Wamp/XAMPP/whatever, BEFORE making changes, just make a new OS image.
Then do anything you like, play around, if it works out fine, if not, just slap the latest image back on, done.
Nothing to worry about.
Plus your work data should be fine since you have all that on the D (data) partition.

The procedure is the same when you multiple drives.
One drive for your OS and all other drives for your data.
SSD drive for the OS should be good.
These days all that hardware is so cheap, and believe me, with this setup you won't need a 1TB or 2TB OS drive.
Keep the OS tight and fast with a 265GB SSD, keep the rest of your data on other drives or partitions.
I think I said it enough times now.

My current setup is that I have dual boot with Windows and Linux, though I must admit I almost never boot into Windows.
Though I will have to use that since there is some proprietary software and hardware I use that needs Windows to work, it is for recording presentations and at the same time the speakers screen.
Coming back to my setup, I use one drive for Windows and Linux and the 2nd drive for the work/data. The work data is formatted to NTFS so that both Windows and Linux can access, read and write to it with no permission issues, at least not that I know of so far.

This is what it looks like in Gparted.
Drive 1 for Windows and Linux.

And drive 2 for the work/data.

Regardless of the space you allocate, with something like this and if done properly, you can use your machine without having to worry about all the issues Windows comes with.
As a bonus, set yourself up with proper firewall rules, get Panda cloud free as anti-virus, done.
https://www.av-comparatives.org/comparison/ gives you a good overview of anti-virus ratings. Click on "Test Charts" so see the overview.

Last not least, if you want to go for it, get a VPN for extra security and lots of benefits.
https://www.privateinternetaccess.com/ has/is serving me pretty good.
Though mind you, if you do things like broadcasting your app onto your mobile devices with Browsersync for example you might need to have the VPN turned off for that.
Not sure, have not tested that.

I can tell you, I have spent countless days/nights/weeks/months getting this stuff right. It is a tough journey and not easy to learn. Though at the end waits a machine that will just work and work for years, without any issues, so that you can get your work done and not loose time configuring or resetting. I have clients that had a hardware mess, applied this method to their hardware and it works to this day, happy campers, though I am not even support, haha.

Oh, some might argue against this, but I never did any Windows updates, don't do them to this day, shut down and turned that service off right at the beginning.
The Windows 10 and 7 latest images with SP updates take care of most of it and work out of the box.
With a VPN, Panda cloud and not doing silly stuff you should be fine.
Yes sure you need to properly config your firewall for that and also have things in your email client to protect you.
For example if you want to be super careful get Sandboxie and isolate all internet facing apps, i.e. email client and browsers.
Like this if someone send your a virus via email or you surf a site with some malware you have that stuff isolated and when you close the app the isloated bit on your hard drive will get wiped securely, done.

Hope this helps. ?

  • Like 1
Link to comment
Share on other sites

On 3/26/2019 at 3:34 AM, happywire said:

Get https://gparted.org/livecd.php

Get Macrium Reflect Free and make sure you have the exe and store that on a USB stick etc.

 

BEAUTIFULLY well written. Incredibly detailed, thank you amigo! ? 

I do plan on dual-booting. Using my old Thinkpad T420, 12GB RAM and 120GB SSD. How much space should I partition for Win, Linux and Data?

 

Link to comment
Share on other sites

Got a T420 as well! That thing is a rock! Used to be my main box before getting a newer ThinkPad.

Hmm, not sure about the 120GB, depends on what you want to do with Windows and Linux and what kind of work you are going to be saving to Data.
Send me more/all details about what/how you work for me to be able to let you know what I would do.

120GB sounds a bit tight but if you don't do games or video/audio encoding, in fact if you just use the machine for coding for web development it should be fine.
Then again if you have lots of graphics editing, i.e. Photoshop and stuff it might be good to get a 2nd SSD for all your data.
Are you going to be using MS Office and stuff?

Not sure, but I think you can fit a 2nd SSD into the T420, no?
Yes you can =>

So regardless of what you are going to do, either get a 512GB SSD for both OS and the data partition or get the hard drive caddy (see video above) and a 2nd SSD, in that case 265GB or 512GB if you can afford it/your budget allows it. Sure we can also try to work it with just the 120GB but I have a gut feeling it might be a bit much.. it really depends..

Regarding Windows, would that be 7 or 10?

Also what model of the T420 do you have, could you supply detailed hardware specs?
i5, i7?

The more info I have the better I could try to help.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...