Owin selfhost:使用netsh添加urlAcl似乎导致503

时间:2016-11-08 23:07:47

标签: security asp.net-web-api windows-8.1 owin

我有一个作为Windows服务运行的简单WebApi的owin selfhost。 创建/安装证书后,通过https访问此WebApi, 我得到了证书,但仍然坚持使用返回码503。

它似乎不是证书问题,浏览器不再抱怨并按预期显示已关闭的锁。

我在证书安装期间更改了服务帐户,因此要测试是否存在问题我将侦听地址更改回http。它运作良好

为了使这一点非常明确,我已经听了http和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

结果一致,接近httpsAddress / api / test返回200 + json,但httpsAddress / api / test返回503,内容= 503消息

只有一个监听地址(httpsAddress),服务也返回503

更新:我的http地址没有urlacl,所以添加后

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

http地址也返回503! &gt;对我来说很奇怪

好消息是,在删除了两个urlacls之后它现在有效,但有人可以解释这里发生了什么吗?

0 个答案:

没有答案