1

I have a owin selfhost of a simple WebApi running as a windows service. After creating/installing certificates to aproach this WebApi through https, I got the certificate working but stayed stuck with a return code of 503.

It seemed not a certificate problem, the browser does not complain anymore and shows a closed lock as intended.

I changed the service account during the certificate installation, so to test if that was the problem I changed the listening address back to http. It worked fine

To make this really clear i had owin listening on both http and https

StartOptions options = new StartOptions();
options.Urls.Add(httpAddress); //port_x
options.Urls.Add(httpsAddress); //port_y
_httpServer = WebApp.Start<HttpHost>(options);

//make test calls
GetDataUsingWebClient(httpAddress) // suceeds, content = json
GetDataUsingWebClient(httpsAddress) // statuscode 503, content = 503 message

The result is consistent, approaching httpsAddress/api/test returns 200 + json but httpsAddress/api/test return 503, content = 503 message

With just one listening address (httpsAddress) the service also returns 503


Update: I did not have an urlacl for the http address, so after adding that

netsh http add urlacl url=http://+:port-nr/ user="NT AUTHORITY\System"

The http address also returned 503! >seems strange to me

The good news is that after deletion of both urlacls it now works, but can anyone explain what happens here?

Arjan
  • 469
  • 4
  • 12
  • It's probably an issue with your url registrations: http://stackoverflow.com/questions/22293445/http-503-service-is-unavailable-when-trying-to-browse-signalr-hubs/22972905 – Tratcher Nov 08 '16 at 23:18
  • Through that topic is downloaded httpsysmanager, which provides more overview. Using that I saw no urAcls present for the ports i use. I added one and the service broke right away. Deleting the acl brings it back up .. weird.. – Arjan Nov 08 '16 at 23:58
  • That does sound strange indeed. Can you post the output of netsh http show urlac? – Rajiv Jan 06 '17 at 15:59

0 Answers0