Fixing "Localhost SSL Connection Error" in Your Browser
Table of contents
Error:
LOCALHOST SENT AN INVALID RESPONSE
REACT ERROR
(node:3638) Warning: An error event has already been emitted on the socket. Please use the destroy method on the socket while handling a 'clientError' event. (Use node --trace-warnings ... to show where the warning was created)
ERR_SSL_PROTOCOL_ERROR
The Issue:
I felt the need to write this post because the original information doesn’t seem to get the attention it deserves.
If you're developing locally and decide to use https://
(or an app requires you to run over HTTPS instead of the usual http://
), you may encounter an SSL connection error after a few days, especially with other locally running apps.
The error reads:
"Unable to make a secure connection to the server. This may be a problem with the server, or the server may be requiring a client application certificate that you don't have."
Strangely enough, when you load localhost in Firefox, Edge, IE, or Safari, the page loads fine. So, what’s the issue?
Common Symptoms:
Before you start Googling terms like "client authentication certificate," "localhost doesn't work on Chrome," "Chrome NET::ERR_CERT_AUTHORITY_INVALID localhost," or "Brave ERR_SSL_PROTOCOL_ERROR" (like I did), take a deep breath. Now, check the URL Brave/Chrome is trying to access—is it HTTP or HTTPS?
The Fix:
Go to
chrome://net-internals
.Select "HSTS" from the dropdown menu.
Enter
localhost
under the "Delete domain" section.Press the Delete button.
Important Note:
This is a temporary fix. Once you access localhost
over HTTPS again, it will be added back to the HSTS list, and you’ll start seeing the SSL connection error once more.
If you know of a more permanent solution to this issue, please share it!
Subscribe to my newsletter
Read articles from Francis Igbiriki directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Francis Igbiriki
Francis Igbiriki
A Mechanical Engineer and Software Engineer. I like to think of myself a FULL STACK ENGINEER. Psyche(: