Grapevine restserver无法通过useHTTPS访问

时间:2017-03-20 14:46:24

标签: c# rest https grapevine

当我将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和证书都有问题。但是我可以在哪里指定证书?

1 个答案:

答案 0 :(得分:0)

Grapevine构建于.NET HttpListener类之上。您从原始帖子中获得的内容足够<代码视角 。但是,还需要在服务器运行的机器上完成更多工作。