Fix it now
Nothing is accepting the connection, so this is neither a certificate trust problem nor a policy problem. Either something else already holds port 443, the certificate binding HTTP.sys keeps is broken, or the listen-only list names an address this machine no longer has. Find out which before you touch the certificate.
Get-NetTCPConnection -LocalPort 443 -State Listen
netsh http show sslcert
netsh http show iplisten
netsh http show urlacl
- If the first command returns nothing, nothing is listening and the bind failed. If it returns an owning process, identify it with
Get-Process -Id <pid>and check whether it registered with HTTP.sys or opened the socket itself. - Compare the certificate hash in the
show sslcertoutput with the thumbprint of the certificate you intend to use. An empty result, or a hash you cannot find in the store, is the binding fault. - Compare
show iplistenagainstGet-NetIPAddress. An empty listen-only list means listen on every address, which is the normal state; an entry naming an address the server no longer has stops the bind. - Rebind the certificate through Remote Desktop Gateway Manager rather than by hand, then restart the Remote Desktop Gateway service and re-run the checks.
Restarting the HTTP service, or deleting an SSL binding with netsh, affects every consumer of HTTP.sys on that server. On a box that also runs IIS or RD Web Access, those go down with it. Record the existing bindings before you change any of them.
If the port listens and clients connect, stop here. If the bind still fails with nothing obviously holding the port, the next section covers reserved ranges and the two registrations HTTPS actually needs.
Why it happens
RD Gateway does not open a socket of its own. It registers URL prefixes with HTTP.sys, the kernel-mode HTTP listener that IIS also uses, and HTTP.sys binds the port once and dispatches requests to whichever registered consumer matches the URL. That is why RD Gateway and RD Web Access can share 443 on the same machine without conflict, and why an application that binds the port directly, outside HTTP.sys, breaks both at once.
HTTPS needs a second registration on top of that. A certificate binding, keyed to an address and port, is stored in the HTTP.sys configuration rather than in IIS. If that binding is missing, names a thumbprint that is no longer in the store, or points at a certificate whose private key the service cannot read, the endpoint never becomes usable even though the port looks reserved. That split is why the certificate can look perfect in the console and the listener still be dead.
Underneath both, the failure is an ordinary socket one. Microsoft publishes 10048 as WSAEADDRINUSE: address already in use, and notes that only one usage of each protocol, address and port combination is permitted. That is the whole of it. Either something has the port, or the address the bind was asked for does not exist on this machine.
Another application has taken port 443 directly
You have this one if The port is held by a named process rather than by the system, and stopping that process frees it.
- Identify the owner with
Get-Process -Id <pid>using the process id from the port listing. - Check whether that application registered with HTTP.sys by looking for its prefixes in
netsh http show urlacl. If it is not there, it bound the socket itself and cannot share. - Move that application to another port, or move it off the gateway entirely.
- Restart the Remote Desktop Gateway service and confirm the port comes up.
The certificate binding is missing or points at a certificate that is gone
You have this one if netsh http show sslcert shows no entry, or a hash you cannot find anywhere in the local computer stores.
- Open
certlm.msc, go to Personal, Certificates, and confirm the intended certificate is present and reports that it has a private key. - Rebind it in Remote Desktop Gateway Manager rather than by hand, so the gateway records the change in its own configuration as well as in HTTP.sys.
- Restart the Remote Desktop Gateway service and re-run
netsh http show sslcertto confirm the new hash.
If you ever add a binding by hand, the application identifier has to match the application that owns the reservation. Copy it from an existing working entry rather than inventing one.
The listen-only list names an address the server no longer has
You have this one if The server was recently re-addressed or had a network adapter removed, and the bind fails with no process holding the port.
- Run
netsh http show iplistenand compare the entries withGet-NetIPAddress. - Remove the stale entry with
netsh http delete iplisten ipaddress=10.0.0.9. - An empty list means listen on every address, which is the normal state for most gateways.
- Restart the HTTP service so the change takes effect, in a window, because every HTTP.sys consumer on the box restarts with it.
Port 443 falls inside a reserved port range
You have this one if No process appears to hold the port and every bind attempt fails immediately.
- List the exclusions with
netsh int ipv4 show excludedportrange protocol=tcp. - If 443 sits inside one of those ranges it has been reserved by another component rather than used by it. Hyper-V and container networking are the usual sources.
- Stop the network address translation service, restart the gateway service so it claims the port, then start the other service again. On a Hyper-V host, plan this for a maintenance window.
- Re-check the exclusion list and confirm 443 is no longer inside a reserved range.
Full reference
Reading the state of the listener
| What you find | Where the fault sits |
|---|---|
| Nothing listening on 443 at all | The bind failed: another process took the port, or the listen-only list is wrong |
| A named application process owns 443 | A direct socket binding outside HTTP.sys |
| The port listens and connections reset instantly | The certificate binding is broken or the private key is unreadable |
| It broke right after a certificate renewal | The thumbprint changed and the HTTP.sys binding still names the old one |
| It broke after the server was re-addressed | A stale entry in the listen-only list |
| Nothing holds the port and the bind still fails | 443 is inside a reserved port range |
The netsh http commands that matter here
| Command | What it does |
|---|---|
netsh http show sslcert |
Lists the certificate bindings HTTP.sys holds, by address and port or by hostname and port |
netsh http show urlacl |
Lists the URL reservations, which is how you tell an HTTP.sys consumer from a direct binder |
netsh http show iplisten |
Lists the addresses in the listen-only list; empty means all addresses |
netsh http delete iplisten ipaddress=<address> |
Removes one address from that list |
netsh http add sslcert ... appid=<GUID> certhash=<hash> |
Adds a binding by hand; the application identifier must match the owning application |
Take a copy of the show sslcert and show urlacl output before you change anything. Both are short, and both are what you will want when the change does not do what you expected and you need to put the server back the way it was.
Why the process that owns the port looks wrong
On a healthy gateway the listening socket is owned by the kernel rather than by the gateway service, because HTTP.sys holds it on everyone’s behalf. That is expected and is not evidence of a conflict. The real test is not which process id owns the port but whether the URL reservations are present: an application with prefixes in show urlacl is sharing properly, and one with no reservations that nevertheless holds the port is binding the socket itself and cannot coexist with anything.
When 443 is reserved rather than used
A reserved range is not a process holding the port; it is the operating system having set that range aside for dynamic use, which stops anything binding a specific port inside it. Hyper-V and container networking both reserve ranges, and the ranges move between reboots, so a gateway that has worked for a year can fail to start after one restart and work again after the next. netsh int ipv4 show excludedportrange protocol=tcp is how you confirm it rather than guessing, and the fix is to make the gateway claim the port before the component that reserves ranges does.
Changing bindings without taking the site down with them
- Every consumer of HTTP.sys on the machine shares the same binding table. Restarting the HTTP service restarts all of them, RD Web Access included.
- Rebind through the gateway console rather than with netsh where you can, so the gateway’s own configuration stays in step with the binding table.
- Note the existing hash and application identifier before you delete a binding. Recreating one from memory is how a five-minute change becomes an outage.
- Test from outside the network afterwards, not from the server. A binding can be correct locally and unreachable through the firewall.
None of this costs anything. It is a port and binding conflict on a server you already own and licence, and no licence state produces it. Moving the gateway to a different port is possible and throws away the main reason to run one, which is that it works from networks where only 443 outbound is permitted. Fix the conflict instead.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
Event ID 15005 |
Not published by Microsoft. It is written by HTTP.sys where the endpoint could not be bound; the entry names the address and port it was trying to reserve | not published by the vendor |
Event ID 15021 |
Not published by Microsoft. It appears against an endpoint whose SSL configuration could not be used; check the binding and the private key | not published by the vendor |
0x00000204 |
Not published by Microsoft. Reported by the client where nothing accepted the connection at all | not published by the vendor |
10048 |
WSAEADDRINUSE, address already in use: only one usage of each protocol, address and port combination is permitted | Microsoft Learn |
Confirm the fix worked
Get-NetTCPConnection -LocalPort 443 -State Listenreturns a listening entry after the gateway service starts.netsh http show sslcertshows a bound hash matching the certificate you intended.netsh http show iplistenis empty, or lists only addresses this server actually has.- An external client connects and a session opens.
- The gateway still binds the port after a full reboot, which is the test that catches a reserved range.
Questions people ask about this
Does this cost anything to fix?
No. It is a port and binding conflict on a server you already own and licence. No purchase changes the outcome and no licence state produces this failure.
Can RD Gateway and IIS really share port 443?
Yes, because both register with HTTP.sys rather than binding the socket themselves. HTTP.sys dispatches by URL, so the gateway endpoints and the web site coexist. Only a direct binder outside HTTP.sys causes a genuine conflict.
Should I move the gateway to a different port?
You can, and you lose the main advantage of running one, which is that it works from networks permitting only 443 outbound. Fix the conflict rather than moving the port.
Why does the certificate look fine in the console but not work?
Because the console shows the store while HTTP.sys uses its own binding table. A certificate can be perfectly valid and simply not be the one bound to the endpoint.
Nothing holds the port and it still will not bind. What else is there?
Check whether 443 falls inside a reserved port range with netsh int ipv4 show excludedportrange protocol=tcp. Hyper-V and container networking reserve ranges, and the ranges move between reboots.
