0

I am trying to create a server application using HTTP Server API (https://learn.microsoft.com/en-us/windows/win32/http/http-server-api-overview). I am unable to run the application with regular user privilege.

From the command prompt in administrator mode I have reserved the URL ACL

C:> netsh http add urlacl url=https://+:56565/tuhin/ user=\Everyone

Output of show urlacl is as below, which show the entry has got persisted C:>netsh http show urlacl

Reserved URL            : https://+:56565/tuhin/
    User: \Everyone
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;WD)

When I am running a application in the normal user privilege the HttpAddUrlToUrlGroup is failing with ERROR_ACCESS_DENIED. I am trying to add the URL https://192.168.1.7:56565/tuhin/tuhin2/ 192.168.1.7 is one of the active address in my machine.

Please suggest what I am doing wrong.

Thank You

1 Answers1

0

I found the mistake. The HttpAddUrlToUrlGroup also need to be called with the same prefix used during the reservation. Passing https://+:56565/tuhin/tuhin2/ to HttpAddUrlToUrlGroup gets accepted when used in an application with normal privileges.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77