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.79k stars 2.52k forks source link

How can I prevent this automatic redirection from HTTP to HTTPS? #594

Open jon9090 opened 3 months ago

jon9090 commented 3 months ago

To generate a certificate for localhost, I ran the following commands:

brew install mkcert
mkcert --install
mkcert localhost

This created the .crt and .key files, which I then used in my applications (https://localhost:4300).

However, I've noticed that when I open an application that doesn't require HTTPS, it automatically redirects to HTTPS (http://localhost:4200).

How can I prevent this automatic redirection from HTTP to HTTPS?

andrewcrook commented 2 months ago

Its not the certificate

This redirect could be because of several things.

  1. some web and proxy servers have rules to redirect http to https e.g apache has .htaccess url files
  2. web browsers have started to have a builtin features to redirect http to https you can disable in the browser's config. however, the browser normally checks if the https version of the site exists if not, it stays with the http version of the site.
  3. some browser plugins/extensions offer the same feature as no 2
  4. if developing software it is possible that some libraries or project code can also redirect.

so it could be one or more of these. It current sounds like 1 or 4 Its also depend on what you are using in your dev environment.