Error: connect ECONNREFUSED 127.0.0.1:443

I got the following error: Error: connect ECONNREFUSED 127.0.0.1:443
I’m using windows 10 with WSL (Ubuntu 20.04)
I’m able to open the site with self signed certificate using any installed browser (Chrome, Firefox even Edge :smile:)
SSL Certificate verification and Proxy are turned off.
Any idea why this may happen?

Hi @hristo.angelov, welcome to the Postman Community :rocket:

Can you explain what you’re attempting to do in some more detail? In which context did you receive that error?

Here’s a nifty little guide on what sort of context will help us help you!

I’m accessing this page fine by any browser installed on my system.


When I try to get this page via postman it is not working

Here is the postman console

I’m using windows 10 with Ubuntu running under WSL2.
The host is described in hosts file pointing to both ipv4 (127.0.0.1) and ipv6 (::1) ip addresses.
Maybe this will help.

Hello,

I have exactly the same problem with:

  • WSL2 running Debian and self-signed certificate
  • Windows 10

That look like a bug of postman :frowning:

Same here with Ubuntu 20.04 running in WSL2

I have the same issue and can easily be duplicated. Setup WSL on Windows 10 with Ubuntu 18.04. Configure apache. Then in Windows add the hosts entries to the hosts file.

127.0.0.1 myname.localhost
::1 myname.localhost

Then try to access https://myname.localhost from Postman. Note: I have SSL setup.

Tell postman not to validate SSL but mine is valid anyhow. And tell postman not to use any proxy. I get the same issue with and without using system proxy.

Postman will give the error Error: connect ECONNREFUSED 127.0.0.1:443.

As a work around if you click on code and output it to curl it works in the command prompt. Note: Windows you need to change the single quote to double quote.

IE: ‘https://…’ to “https://…”

curl --location --request GET “https://myname.localhost

1 Like

Would anybody help me with this…???

Hi everyone! This looks like a bug to me. Could you file it in our issue tracker on GitHub? We use GitHub for issues and feature requests.

Hi, facing the same issue from W10 to a WSL2 (Ubuntu-20.04) apache webserver.

I created an issue (I’m not used to it, so any feedback to make it better is welcome)

Thanks

Hi everyone,

It looks like the hostname is resolving to 127.0.0.1 via Postman. My guess is the URLs you’re using are .local, which would require an mDNS lookup that perhaps Postman is not doing.

If that suspicion is correct, you can still use the IP address of your running server instead of the hostname. From Powershell, you should be able to run wsl hostname -I to get your IP address.

Note: Your TLS cert will show as invalid if it’s pointing to the hostname. You may have to ignore SSL errors for this to work.

Hope this helps.

Best,

Kevin