Windows 11 and API port blocked in normal mode

Hello Jared, Ken,

I have trouble using the API with Windows 11. If I run SGP normally (not in admin mode), then a form pops up when starting SGP, asking me if I want to run netsh.exe to activate the API port. I click yes of course. However, the port is still blocked. I cannot access the API command list at http://localhost:59590/metadata, nor can I send any API commands to SGP. From the logfile it also looks like SPG cannot open the API port.

If I run SGP as admin, these problems all go away (there is no popup form at all). I dont think this is a good solution in general, as several users have reported connection problems when some programs run in normal mode and some in admin mode.

Should I add SGP to the firewall, or netsh.exe, or both ? Or is this something that needs adressing in SGP ?

Thanks, Mikael

Link to Logs

Approx time of issue: 15:30

Useful Info

OS: Microsoft Windows 11 Famille
Ver: 4.2.0.955 (32-bit)
.NET: 4.8
ASCOM: 6.6.1.3673

Here is the screen shot of the popup form;

We definitely agree with this. Running in admin mode can create a whole host of other interoperbility issues.

We always run on Windows 11 and never in admin mode so, at first glance, I am unsure where this comes from.

What version of Windows is it? Home?

If you are inclined to experiment, this is the script we run when we try to reserve the port. We have always meant to make this more dynamic and work harder to find a free port, but it hasn’t ever seemed to be a problem.

Maybe it’s a localization issue? It’s doubtful, but I am curious what happens when you run that script manually.

Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "netsh", "http add urlacl http://+:59590/ user=Everyone", "", "runas", 0

On my laptop running Windows 11 Pro English version I have had zero issues. One my PC tower running Windows 11 Home French version the API isn’t reserved, meaning the API doesn’t work and it doesn’t appear on the list when typing “netsh http show urlacl”.

Ken, I played around with the netsh in the command prompt, and this is what I learned on my Windows 11 French version.

Running CMD in admin mode I can reserve the url if I use my specific username “afzelius”, like this:

C:\Windows\System32>netsh http add urlacl url=http://+:59590/ user=afzelius

Ajout réussi de la réservation d'URL

After this I can run SGP and acces the API, even in normal mode (not admin mode). Btw, I cannot reserve the url without running CMD in admin mode.

However, neither the Everyone or Tout le monde usernames work, and they give different errrors. I think on this French system it should be Tout le monde, but netsh maybe doesn’t handle spaces ? And I could not get it to work with neither “”, nor ‘’ around the Tout le monde.

Looks to be a regional issue thing to me ?

If you have any other ideas I can test them.
Mikael

I solved that same issue by changing the Windows 11 language from FR to EN.

1 Like

Yes, that seems a certainty here. Thanks for all the additional info
 I’ll need to do some thinking and research to better understand how to approach this issue (or maybe use a different method altogether since SGPro cannot have knowledge of a username with admin privileges ubkess user provides it).