Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebAPI self-host 503 error (HttpSelfHostConfiguration setted HttpSelfHostConfiguration)

I have a window service using self-hosted WebAPI. HttpSelfHostConfiguration.HostNameComparisonMode set HostNameComparisonMode.Exact for hostname strong match.

var config = new HttpSelfHostConfiguration(uri);
config.HttpSelfHostConfiguration = System.ServiceModel.HostNameComparisonMode.Exact;
this._server = new HttpSelfHostServer(config);
_server.OpenAsync().Wait();

And URL reservation for the specified URL namespace for the domain.

netsh http add urlacl url=https://+:443/ user=EVERYONE

To bind an SSL certificate to a port number.

netsh http add sslcert ipport=0.0.0.0:443 certhash=xxxxxxxxxxx appid={xxxxxxxxx}

But Result appear HTTP 503 error. I don't know state.

like image 891
Jungho Choi Avatar asked Jan 15 '14 05:01

Jungho Choi


1 Answers

I had a similar problem. Problem in my case was duplicate urlacl for my URL.

netsh http show urlacl
...
http://+:80/api 
http://127.0.0.1:80/api (or any IP)

Remove any possible duplicate urlacl for your program.

like image 163
supertopi Avatar answered Nov 03 '22 14:11

supertopi