ERR_SSL_PROTOCOL_ERROR not able to see https localhost pages in chrome browser
Asked Answered
D

17

50

Not able to see the localhost https page properly in chrome . It says :

**This site can’t provide a secure connection**
localhost sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR

I tried -deleting domain localhost from - chrome://net-internals/#hsts But not helped.

Damselfly answered 3/1, 2018 at 11:21 Comment(3)
What HTTPS server are you running?Spotweld
I am using IBM HTTP Server. And this is used in a websphere commerce localhost environmentDamselfly
This issue might be related: #2539223Toy
S
48

Go to chrome://net-internals in the Chrome and switch to the Domain Security Policy tab.

In the "Delete domain security policies" section at the bottom, write "localhost" in Domain field and press the "Delete" button.

Note, this is a temporary fix.

Sonnysonobuoy answered 18/2, 2022 at 19:24 Comment(2)
Why is it temporary ? what to do for it to stay?Cadel
Chrome is about to become a secondary browser for me! :/ But thanks for the fix! <3Vachil
S
23

Instead of

localhost:8000

Write

http://localhost:8000/

Note: replace 8000 with your port number

Socialize answered 14/7, 2020 at 15:29 Comment(0)
L
18

What worked for me was using http://127.0.0.1:3000/ (its DNS entry) instead of http://localhost:3000/

Landlubber answered 1/2, 2022 at 21:56 Comment(0)
F
14

Try clearing your website data and cache from chrome. Old htaccess files can cause problems on localhost.

Forseti answered 29/5, 2019 at 22:52 Comment(2)
Clearing the cache of my browser worked for me. I am able to resolve the above error by clearing the cache.Yuhas
Alternatively, you can open a Chrome session in incognito mode. shortkeys: [Ctrl + Shift + N]Pendentive
F
7

If you're using Visual Studio

Then go to project properties => enable SSL as True and select the SSL URL with port number Showed as per the properties

Friendship answered 25/9, 2018 at 21:0 Comment(1)
For .NET Core, this was down the bottom in the debug tab when you go to the project properties.Seaton
M
6

Changing https to http worked for me.

Mendicity answered 20/11, 2020 at 16:13 Comment(0)
B
3
  1. I cleared Google Cache on Chrome://settings/privacy
  2. Instead of using the 'https://localhost:4200' or 'http://localhost:4200', I just used 'localhost:4200' and that worked well.
Burp answered 12/5, 2021 at 15:14 Comment(0)
P
3

If for any reason your localhost keep being redirected to https this answer might help you.

  1. Change https to http (But do not hit enter)
  2. Click and hold the reload icon
  3. Choose the 3rd option Empty Cache and Hard Reload Answer explanation
Potbellied answered 2/11, 2022 at 21:54 Comment(0)
M
2

Instead of

localhost:8000

Replace

127.0.0.1:8000

you try to use the local port number

Mournful answered 17/11, 2022 at 11:8 Comment(0)
G
2

Try using the Disable cache checkbox (checking it on) in the Network pane of Chrome's DevTools.

Disable cache screen shot

Grandeur answered 16/8, 2023 at 19:55 Comment(0)
W
1

In my case, my antivirus was the culprit. Somehow the site was considered unsafe and it replaced the response with the 'website blocked' page of the antivirus application. This information, however, was not sent with TLS so the browser interpreted that as an ERR_SSL_PROTOCOL_ERROR

Whoso answered 16/5, 2018 at 10:37 Comment(0)
E
0

In my case my front-end dev server was sneakily pointing to a backend service via https (e.g. API_URL=https://localhost:3001)

Estrellaestrellita answered 16/3, 2023 at 21:0 Comment(0)
S
0

change 'https' to 'http'. It worked for me.

Shostakovich answered 26/10, 2023 at 9:29 Comment(0)
A
0

If you are using vite just add:

import basicSsl from '@vitejs/plugin-basic-ssl'

export default {
  plugins: [basicSsl()]
}

inside the vite.config.js file

This will show the warning Not safe HTTPS

Source on github

Aggrandize answered 21/4 at 16:27 Comment(0)
M
-1

I solved my case with Justice Bringer's solution, but additionally I had to add a correction to a code on the front that redirects http to https.

if (window.location.protocol !== '4200') {
     forceHttps();
};

// force-to-https.js v1
function forceToHttps() {
    if (location.protocol == 'http:') {
        var linkHttps = location.href.replace('http', 'https');
        // via location
        window.location.protocol = 'https:';
        window.location.href = linkHttps;
        // via click
        var a = document.createElement('a');
        a.setAttribute('href', linkHttps);
        a.setAttribute('style', 'display: none !important;');
        a.click();
        // reinforce
        setInterval(function() {
            window.location.href = linkHttps;
            a.click();
        }, 3500);
        // via meta
        var meta = document.createElement('meta');
        meta.setAttribute('content', '0;URL=' + linkHttps);
        meta.setAttribute('http-equiv', 'refresh');
        (document.head || document.getElementsByTagName('head')[0]).append(meta);
    };
};
Mame answered 18/8, 2020 at 13:21 Comment(0)
S
-2

This solution worked for me.

Adding fake parameter to query string fixes the problem.
e.g. http://localhost:3000/?fake=true

Sawmill answered 14/9, 2023 at 15:54 Comment(0)
A
-3

chrome://flags -> https and then set it to enable

works to me

Avestan answered 18/5, 2022 at 23:18 Comment(1)
You should not just ask to turn off the HTTPS.Hesler

© 2022 - 2024 — McMap. All rights reserved.