FiloSottile / mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.
https://mkcert.dev
BSD 3-Clause "New" or "Revised" License
48.8k stars 2.52k forks source link

mkcert ruined my localhost:8080 #129

Closed tr1s closed 5 years ago

tr1s commented 5 years ago

I had to run these commands in order to get slate to work, it never worked... Then I found some hacks in the github issues of slate, it finally worked by creating some keys in my project.

Now when I run webpack-dev-server on my own personal projects using my boilerplate, localhost:8080 doesn't work anymore, none of them do. I tried doing mkcert install and mkcert localhost and it created my keys, but still nothing.. I get this below.

cleanshot 2019-02-05 at 11 51 43 2x

How do I get things back to normal? I don't want all these extra steps just to run my personal projects. All I had to do before was type "npm start" and everything was ready to go. Ever since me setting up one slate project everything else is ruined so far.

Any ideas? How can I fix this?

FiloSottile commented 5 years ago

ERR_SSL_PROTOCOL_ERROR suggests that the issue has nothing to do with the certificate and key that mkcert generates, but is a problem with whatever HTTPS/TLS implementation you are using.

tr1s commented 5 years ago

@FiloSottile so what do I do about this?

I know for a fact that everything was fine before I brew installed mkcert and set up this slate project. I can't even get my static freelance projects running right now. I didn't change any code whatsoever in my other projects. How do I revert back from all this?

FiloSottile commented 5 years ago

I'm sorry to hear this, but it sounds like it worked before you started using HTTPS and TLS, so you have to find out what software you are using for HTTPS and TLS and what the issue with it is. mkcert does not run any code after generating the certificate and key files.

tr1s commented 5 years ago

@FiloSottile Can you give me some sort of direction?

I created a webpack boilerplate, I used webpack cli/webpack-dev-server, I run npm start and everything works as it should. I have no extra software that's making me use HTTPS/TLS. I just made a config and everything worked.

Now that I have mkcert nothing works. I don't really know what you're telling me here about extra software. There is no extra software. Nothing I'm trying is fixing this so far

FiloSottile commented 5 years ago

I know next to nothing about the Node.js ecosystem, but I assume you did not just run mkcert, you probably also changed some options to tell your server to load the certificate mkcert created. That's the HTTPS code that would be having issues.

(If not, have you tried loading http://localhost:8080 instead of https://?)

tr1s commented 5 years ago

I went through my command history and I think these two got the slate project to work. Does that mean anything to you?

I went through the install process from the mkcert docs recently to try and override it but nothing happens. Http just get's forced to https to answer your question.

cleanshot 2019-02-05 at 16 08 03 2x cleanshot 2019-02-05 at 16 08 16 2x cleanshot 2019-02-05 at 16 10 15 2x
tr1s commented 5 years ago
cleanshot 2019-02-05 at 16 12 25 2x
tr1s commented 5 years ago

@FiloSottile is there a way I can fully revert this and delete anything and everything mkcert created? I need to abandon this slate project so I can fix everything else asap.

tr1s commented 5 years ago

Feel free to close this. I had to recover my mac from the day before this happened.

FiloSottile commented 5 years ago

I'm sorry to hear that. If you have further problems with HTTPS aside from the certificate itself, it looks like the name of the project you need to open an issue in is "Slate".

skywinston commented 5 years ago

The solution to this problem can be found here: https://github.com/Shopify/slate/issues/726#issuecomment-431372434

saurabhsethi1102 commented 3 years ago

You can always use a private window to route to http://localhost

iulianalbu commented 3 years ago

@saurabhsethi1102 Yea, your idea it's working, but for Postman not.

@tr1s I manage to fixed this issue

Drjacky commented 7 months ago

Same here! Working with Ktor, and after this, it fixed my issue; I could see the Welcome page. Then I installed mkcert and it ruined my setup! Uninstalling all the certs it created and itself didn't help either

Unfortunately this is no an option for me:

I had to recover my mac from the day before this happened.

Drjacky commented 7 months ago

Same here! Working with Ktor, and after this, it fixed my issue; I could see the Welcome page. Then I installed mkcert and it ruined my setup! Uninstalling all the certs it created and itself didn't help either

Unfortunately this is no an option for me:

I had to recover my mac from the day before this happened.

In this case, you need to define a new port; not sure where and how, but the ruined address(locahost) and port is cached!

raul-rtl commented 7 months ago

same here, after installing mkcert it ruined my setup, I tried iulianalbu solution but not success

Jeffxz commented 6 months ago

This helped me on chrome https://stackoverflow.com/questions/25277457/google-chrome-redirecting-localhost-to-https What I did was enter chrome://net-internals/#hsts, query for "localhost", if there is any hit then delete "localhost" and it worked for me.

MisterDr commented 1 month ago

In my case solution was rather simple. Since I am using VSCode and it has ugly habit to forward the ports on whatever it sees at the console, I simply removed forwarded ports. Double check to see if anything else is listening on your development port.