West Wind Internet and Client Tools
Windows 11: Error 12029 A Connection to the Server Could Not Be Established
Gravatar is a globally recognized avatar based on your email address. Windows 11: Error 12029 A Connection to the Server Could Not Be Established
  Tom Belllin
  All
  Apr 10, 2024 @ 05:43am

I have a new-ish Windows 11 machine that I haven't tried to use Internet and Client Tools with since I set it up.

When I try to connect to anything I immediately get an error (it's not timing out, just failing)

"12029 A connection to the server could not be established."

Doesn't matter what host I try to connect to, whether I use HTTP or HTTPS. I even downloaded a fresh copy of the wwICT library and ran the samples (wwipstuff_samples.prg) and get the same message.

Tracing through, the call to HttpSendRequest fails and returns 12029.

Things I've tried:

  • ensuring that Windows is using TLS 1.2
  • made a firewall rule for vfp.exe.
  • disabled the firewall altogether.
  • built a separate exe and added a firewall rule for it.

Of course, it still works perfectly fine on my Windows 10 laptop (and on my production server). So it seems like a Windows 11 thing where I need to toggle some obscure setting, but I have no idea where to go from here. Any clues would be appreciated.

Thanks

Gravatar is a globally recognized avatar based on your email address. re: Windows 11: Error 12029 A Connection to the Server Could Not Be Established
  Rick Strahl
  Tom Belllin
  Apr 10, 2024 @ 02:15pm

Any other AV software running (other than Defender) that might be interfering? Connection issues like this typically mean that the HTTP request is blocked before it ever goes out at the outbound socket.

Also what's the code you're running?

Make sure you try the simplest thing possible first:

do wwhttp
loHttp = CREATEOBJECT("wwHttp")
lcHtml = loHttp.Get("https://west-wind.com")  // or whatever

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Windows 11: Error 12029 A Connection to the Server Could Not Be Established
  Tom Belllin
  Tom Belllin
  Apr 14, 2024 @ 07:21am

Hey Rick,

Thanks for your response.

I agree that something is blocking/rejecting the request before its even sent. But what? I have Microsoft Defender and Windows Security.

I ran your code snippet and got the same result:

  • lcHtml is blank
  • loHttp.cErrorMsg is "A connection to the server could not be established."

When I debug through it fails at HttpSendRequest same as before.

I disabled the firewall, no effect.

I can't disable Windows Defender AV, but it doesn't report any activity.

I also reinstalled Windows, thinking maybe there was something off with the wininet library. But it did not fix the issue. (Though I now have a fresh install of Windows, so that's a good thing!)

This is so weird.

Gravatar is a globally recognized avatar based on your email address. re: Windows 11: Error 12029 A Connection to the Server Could Not Be Established
  Rick Strahl
  Tom Belllin
  Apr 14, 2024 @ 11:37am

By default Windows will not block, but there can be company policies that can block certain ports from applications to run. Certain AV tools (other than Defender) can also be very strict about restricting outgoing HTTP requests from applications unless they are explicitly allowed.

The other thing that can be an issue is a Proxy or VPN in which case the routing may not work.

Does this work from Powershell?

invoke-webrequest https://west-wind.com

If that doesn't work then we know there's aproblem with your connection setup. If it does then the issue is more likely with the WinInet specific settings or AV related issue.

Finally take a look and see what Internet Options from your Windows Startmenu shows in the Connection dialog for VPN and LAN Settings. These are settings that WinInet uses for connections (but other tools like .NET or Node do not).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Windows 11: Error 12029 A Connection to the Server Could Not Be Established
  Tom Belllin
  Rick Strahl
  Apr 14, 2024 @ 06:40pm

Thank you, Rick. Powershell script worked fine.

Nothing in Proxies or anything else.

Turns out, I needed to go to "Lan Settings" in Internet Options and choose "Detect Automatically" and everything's working again.

Gravatar is a globally recognized avatar based on your email address. re: Windows 11: Error 12029 A Connection to the Server Could Not Be Established
  Rick Strahl
  Tom Belllin
  Apr 14, 2024 @ 09:29pm

Yeah - if there's any sort of special routing going on it's important that Detect Automatically is on. That is the default setting for Windows, so not sure what would have triggered that off.

The other thing that can happen is if you use a Proxy like Fiddler or other IP Sniffing software that can sometimes modify those settings. If the app crashes it can leave the proxy or no-detect setting in place which can cause problems with other apps.

+++ Rick ---

© 1996-2024