[英]Grapevine restserver not reacheable with useHTTPS
當我將useHttps屬性設置為true時,我無法訪問服務器。
服務器的實例化如下所示:
class Listener
{
RestServer server;
public Listener()
{
server = new RestServer();
server.Port = "8137";
server.UseHttps = true;
}
}
服務器啟動,控制台輸入告訴我它在https:// localhost:8137上偵聽,但是當我嘗試發出請求時(在Fiddler中),我收到錯誤消息:502 Fiddler - Connection Failed。
The connection to 'localhost' failed.
System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https> HTTPS handshake to localhost (for #38) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. < An existing connection was forcibly closed by the remote host
對我來說,看起來HTTPS和證書都有問題。 但我在哪里可以指定證書?
Grapevine構建於.NET HttpListener
類之上。 從代碼的角度來看 ,您在原始帖子中已經足夠了 。 但是,還需要在運行服務器的計算機上完成更多工作。
請參閱HttpListener文檔 ,尤其是頁面底部的注釋。
StackOverflow上有一個很好的寫入,用於啟用對localhost的https支持。
如果遇到類似這樣的問題 ,我建議在StackOverflow上搜索,因為問題與Grapevine無關,而且與證書設置有關。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.