Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERR_CONNECTION_REFUSED .dev redirecting to https

Today I went to bring up our .dev localhost environment to do some work and noticed that the site was redirecting to https. I thought this was strange and assumed it was searching for the server after being unable to location it on port 80.

This was resulting in an ERR_CONNECTION_REFUSED error. This was perplexing as it was loading fine in Firefox.

like image 872
Jacob Thomason Avatar asked Oct 24 '25 16:10

Jacob Thomason


1 Answers

The solution here is that Google purchase the .dev TLD a year or two ago and made announcements that these would stop working at some point. I knew this, but it escaped me that this was what was causing this issue.

As it turns out, the most recent versions of Chrome and Safari both add the .dev TLD to the HSTS list, forcing HTTPS compliance. This is likely an authenticity move by Google and Apple for the .dev TLD, in order to prevent domain spoofing.

Regardless, if you rely on HTTP support for your .dev TLD, it's not going to work anymore. Save yourself the time and headache, change the TLD to something like .test and wait until the proposal for implementation of the .localhost TLD has been implemented.

Note: .local while it sounds nice is used by Apple's Bonjour service for discovery. This is not advised.

Update: Google has now gone and starting selling domain registrations on the .dev TLD. Thanks Google!

like image 172
Jacob Thomason Avatar answered Oct 26 '25 10:10

Jacob Thomason



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!