"Connection refused" means your laptop reached the target machine but the target said no. Either nothing is listening on that port, or a firewall is blocking it.

"Connection refused" vs. "Connection timed out"

  • Refused: a server is there, you reached it, but no service is accepting on the port. Quick failure.
  • Timed out: nothing replied at all. Usually firewall blocking, or wrong IP.

The distinction tells you where to look.

1. Test the port

Test-NetConnection -ComputerName <target> -Port <port>

(PowerShell)

Output tells you:

  • TcpTestSucceeded: True → port is open, service responded; problem is application-layer
  • TcpTestSucceeded: False → port closed or firewalled

2. Common ports

| Port | Service |<br>|---|---|<br>| 21 | FTP |<br>| 22 | SSH |<br>| 25 | SMTP (outbound mail) |<br>| 53 | DNS |<br>| 80 | HTTP |<br>| 110 | POP3 (mail retrieval) |<br>| 143 | IMAP (mail) |<br>| 443 | HTTPS |<br>| 445 | SMB / File sharing |<br>| 587 | SMTP submission |<br>| 993 | IMAP over TLS |<br>| 995 | POP3 over TLS |<br>| 1433 | SQL Server |<br>| 3306 | MySQL |<br>| 3389 | Remote Desktop |<br>| 5432 | PostgreSQL |<br>| 5900 | VNC |

3. Windows Defender Firewall

If your local app is being blocked from receiving connections:

  1. Control Panel → System and Security → Windows Defender Firewall → Allowed apps
  2. Find your app — tick both Private and Public if you want it to work everywhere
  3. If it's not in the list, click Allow another app and browse to the executable

4. Third-party AV firewalls

If you have Norton, Avast, McAfee, or similar with its own firewall, that one may be blocking even when Windows Firewall is fine. Open the AV control panel and look for outgoing or incoming connection blocks.

5. Corporate firewall

If your laptop is at the office and a specific application can't reach an external server, the corporate firewall may be blocking the port. Common ones IT blocks for security:

  • 22 (SSH) — some companies block outbound SSH to enforce auditing
  • 3389 (RDP) — blocked outbound to prevent lateral movement
  • 25 (SMTP) — blocked to prevent spambots; use 587 instead

If you legitimately need a port unblocked, raise a ticket with the business justification.

6. VPN

A VPN reroutes some or all traffic. After connecting to VPN:

  • A previously working external service may stop working (now routed through VPN, blocked corp-side)
  • A previously failing internal service may start working (now on the corp network)

Disconnect VPN and retest if you're not sure.

7. Localhost vs. network

If an app on your laptop should connect to another service on your laptop and can't:

  • localhost and 127.0.0.1 are the same thing for almost everything
  • A few apps need the actual hostname instead — try replacing localhost with your machine name

8. SSL/TLS errors

If the port is open but you get certificate errors:

  • Your laptop's clock is wrong — fix it
  • The certificate is self-signed and not in your trust store — depends on the app
  • The certificate expired — vendor or admin needs to renew

When to ticket

Raise a ticket if:

  • A port is blocked on the corporate firewall and you have business need
  • A specific external service stopped working corporate-wide
  • Your test shows a port should be open but isn't

Include the target hostname/IP, the port number, the exact error message, and whether you're VPN'd in.