c# - .NET HttpListener - 设置浏览器代理时监听 "https://*.8080"时没有流量?

标签 c# .net ssl https httplistener

背景 - 我可以让 HttpListener 为 HTTP 流量正常工作。但是,我在 HTTPS 流量方面遇到了问题。

问题:如何更改下面的代码,以便我的 HttpListener 实际接收对“https”URL 的浏览器请求?

注意 - 目前 firefox 的代理设置设置为“localhost:8080”,当我在端口 8080(“https://*:8080/”)上监听流量时,我在 firefox 中输入一个 HTTPS url,我没有收到任何流量? (当我只听 http 并输入正常的 http url 时,它工作正常)

  _httpListener = new HttpListener();
  _httpListener.Prefixes.Add("https://*:8080/");
  _httpListener.Start();

谢谢

最佳答案

来自 MSDN

If you create an HttpListener using https, you must select a Server Certificate for that listener. Otherwise, an HttpWebRequest query of this HttpListener will fail with an unexpected close of the connection.

You can configure Server Certificates and other listener options by using HttpCfg.exe. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/http/http/httpcfg_exe.asp for more details. The executable is shipped with Windows Server 2003, or can be built from source code available in the Platform SDK.

虽然不确定 100%...

关于c# - .NET HttpListener - 设置浏览器代理时监听 "https://*.8080"时没有流量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2641891/

相关文章:

ssl - Netty、SSL 和内存使用

amazon-web-services - 浏览器加载 aws 负载均衡器说连接不是私有(private)的

java - 使用 HTTPS(不受信任的证书)访问带有 Java 的网站时出现问题

c# - 如何下载并安装 32feet.net api

c# - 如何从 MySQL 数据库更新 Entity Framework 模型?

c# - 处理将可变长度结果返回到固定缓冲区的方法的最有效方法是什么?

c# - 我如何在 ASP.NET MVC Controller 中使用 Lazy<T>?

c# - C# 中字符串连接的内存分配

c# - 类似于自动回复的功能

.net - 在 .NET 中,如何从 "0.000"转换为 'long'?