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_ERRORI tried -deleting domain localhost from - chrome://net-internals/#hstsBut not helped.
10 Answers
Try clearing your website data and cache from chrome. Old htaccess files can cause problems on localhost.
2Instead of
localhost:8000Write
Note: replace 8000 with your port number
0If you're using Visual Studio
Then go to project properties => enable SSL as True and select the SSL URL with port numberShowed as per the properties
1Changing https to http worked for me.
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.
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
- I cleared Google Cache on Chrome://settings/privacy
- Instead of using the ' or ' I just used 'localhost:4200' and that worked well.
What worked for me was using (its DNS entry) instead of
chrome://flags -> https and then set it to enable
works to me
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); };
};